I have a shared library project using c++20 solution(there are a module named MyDll in it).And I use import
to use some std modules such as string
and vector
.
When I try to use this shared library in another project in the solution(I will call it Application),I use import MyDll
and successfully imported the module.However the compiler reported “can’t find headerUnit e:compilervisual studio 2022communityvctoolsmsvc14.40.33807includestring”
But I can find this headerUnit in the expolorer.And I notice that the compiler converted all uppercase letters in the path to lowercase letters.I wonder if it’s causing the error.
I use Visual Studio 2022.
But if I import the std modules used in the shared library, there’re no error again.
import <iostream>;
//--modules I use in the shared library--
import <string>;
import <string_view>;
import <vector>;
//-------------------
import MyDll;
int main()
{
...
return 0;
}
but I don’t want to import every std module used in the shared library.
Xmony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.