一再看到有人在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 recently
downloaded VS2005 SP1 you may find that some of your existing programs
and some of the samples that ship with Windows Mobile SDK will fail to
compile. Even if you're able to make them compile they may issue a
warning like "warning LNK 4099: PDB 'libbmt.pdb was not found".
This is because VSD has updated the compilers for VS2005 SP1 to be
on par with WinCE 6 compilers which included /GS support. So, for
projects that don’t include libc/msvcrt or turn off /GS, you will run
into these errors on pre-WinCE 6 platforms
As a workaround you should explicitly include "libcmt.lib" in the
list 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就行了)。