I have a VS2010 dll I'm trying to link into a QT project. I'm using QT version 4.7.4 that I built using MSVC2010. QT Creator is also using MSVC2010 to compile.
I'm implicitly linking by including the header files, referencing the .lib in the pro file, and placing the .dll in the execution folder.
Right now I'm only using functions from one class from the dll. Some of the functions link, some of them don't. Dependency walker confirms that they're all being exported just fine.
The functions th开发者_如何学Cat don't link take a std::wstring or a std::wstring* as a parameter.
Is something redefining wstring somewhere? Any ideas would be helpful.
So for anyone else getting this problem, I just figured it out.
The linker was breaking because Visual Studio by default maps wchar_t to __wchar_t, and QT does not.
To fix: Go to Project Settings -> Configuration Properties -> C/C++ -> Language and uncheck the "Treat WChar_t As Built in Type" property.
精彩评论