下载jsoncpp源码后,导入vs2010创建工程,编译jsoncpp出现链接错误:
>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
修改子系统设置即可:
Project -> Properties -> Configuration Properties -> Linker -> System ->SubSystem,原来是/subsystem:windows,这里改为(/SUBSYSTEM:CONSOLE)。
原因:
本是console程序,用vs打开时被当成了windows程序。
对编译jsoncpp来说,目标是要编译为lib,改成编译为lib后这个问题也就不存在了。