Windows Mobile 编译错误解析:LNK2019: unresolved external symbol __GSHandlerCheck

来源:互联网 发布:齐次矩阵是什么 编辑:程序博客网 时间:2024/06/06 01:47

一再看到有人在CSDN论坛上面问, 我的PPC/SMARTPHONE的SDK example为什么编译不过,我没有做过任何的修改啊!然后出现的错误都是类似的 LNK2019: unresolved external symbol __GSHandlerCheck 的错误,然后出了错误, 大抵都失去了对Microsoft的信任:)那问题的缘由处在什么地方呢?其实在MSDN Blog上面有对于类似问题的说明一下的信息出自:http://blogs.msdn.com/mgaur/archive/2006/12/21/lnk2019-unresolved-external-symbol-gshandlercheck.aspx 有兴趣的话可以点击去看看详细。

 

If you're a native C++ smart device developer and recentlydownloaded VS2005 SP1 you may find that some of your existing programsand some of the samples that ship with Windows Mobile SDK will fail tocompile. Even if you're able to make them compile they may issue awarning like "warning LNK 4099: PDB 'libbmt.pdb was not found".

This is because VSD has updated the compilers for VS2005 SP1 to beon par with WinCE 6 compilers which included /GS support. So, forprojects that don’t include libc/msvcrt or turn off /GS, you will runinto these errors on pre-WinCE 6 platforms

As a workaround you should explicitly include "libcmt.lib" in thelist of additional libs to link against and turn off the linker warning(/nowarn:4099).

 

这里已经说的很清楚了, VS2005在安装了SP1以后,那些没有显示link libcmt.lib或者没有关闭/GS编译选项的都有可能碰到如此的错误,解决办法就是显示地去link libcmt.lib就可以了。(就是在Linker=>Input=>Additional Dependencies里面添加libcmt.lib就行了)。

 

原创粉丝点击