1)error LNK2019:无法解析的外部符号——解决记录
解决方案:找不到lib库文件导致,当工程属性都配置正确的前提下(库包含目录,库附加目录,链接器输入库,动态库配置都正确)还是会报错,解决方法如下:cpp源文件主程序最前面直接添加预编译库指令
#pragma comment(lib,“osgViewerd.lib”)
#pragma comment(lib,“osgDBd.lib”)
#pragma comment(lib,“OpenThreadsd.lib”)
#pragma comment(lib,“osgd.lib”)
2)如何防止宏重定义(How to prevent macro redefinition):例如 1>d:\windows kits\10\include\10.0.17763.0\shared\minwindef.h(130): warning C4005: “APIENTRY”: 宏重定义
解决方案:主程序前加包含目录#include <windows.h>
备注:实测中发现,当按问题1的方法解决时,问题2便不会再报错(不需要windows.h包含目录)