LINK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string的解决方案

事情的起因是用VS2003编译ogre的时候,写了一个demo,死活链接不过,总是提示,unresolved external symbol "__declspec(dllimport) public: class std::basic_string,很郁闷的,甚至一度想要放弃VS2003算了,但是后来想想还是再找一找,最后在一国外论坛找到了解决方法,原文是这样的:

You should set the same runtime library settings for all your libraries and the main app. If you're using Visual Studio versions 2002-2010, check options:  C++->Code Generation->Runtime Library
Last edited on
大意是:

你应该设置相同的运行时库给你所有的库和主要程序,如果你使用Visual Studio版本是介于2002-2010版本的,检查选项:C++-》代码生成-》运行时库

最后编辑

这个虽然没有说具体的解决方案,但是最起码从这里获得了解决的思路,于是我就一个个的试了所有的选项,最后试到“多线程 DLL(/MD)”选项的时候,链接成功了。

猜你喜欢

转载自blog.csdn.net/u012878073/article/details/43983683