[Revisit.SolidMCP] 自定义编译QT解决LNK2019

编译QT不难,短短BAT就可以搞定:

---------------------------------------------------------------------------------------

call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
cd /d S:\Components\CPlusPlus\QT\QT_4.6.2
configure   -fast -opensource -confirm-license   -platform win32-msvc2008 
nmake
md temp
move lib\*.pdb temp
nmake clean
move temp\*.pdb lib

------------------------------------------------------------------------

因为一直没有深入QT,所以也没有碰到过什么问题,这几日却被一LNK2019所困扰,百思不得其解:

----------------------------------------------------------------------------------------------------------------------------------------

error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QString __cdecl QString::fromStdWString(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)"

---------------------------------------------------------------------------------------------------------------------------------------

后来知道QT的默认Build没有把wchar_t作为内建类型,才导致这个Link Error:

现在不想重新Build QT,等他日有时间,修改一下Pro文件,连带和Debug/Optimization的选项也可以搞定:

After ---- Before

posted on 2011-07-11 22:08  飘行天下  阅读(990)  评论(0编辑  收藏  举报

导航