使用VS2013+QT5.7新建一个OpenDDS项目,假设已经包含目录和链接库都已经配置好了,编译通过了,但是在链接的时候,还是出现了错误:
1>ReadData.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: long __cdecl ACE_Log_Msg::log(enum ACE_Log_Priority,char const *,...)" (__imp_?[email protected][email protected]@[email protected]@PBDZZ)
1>ReadData.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: long __cdecl ACE_Log_Msg::log(enum ACE_Log_Priority,char const *,...)" (__imp_?[email protected][email protected]@[email protected]@PBDZZ)
1>ReadData.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall ReadData::onReceive(struct TranslateData::TranslateJsonData const &)" (?[email protected]@@[email protected]@@@Z)
1>ReadData.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall ACE_New_Allocator::protect(long,int)" (?[email protected][email protected]@[email protected])
1>ReadData.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall ACE_New_Allocator::sync(long,int)" (?[email protected][email protected]@[email protected])
再次仔细查看了一下,各种配置还是没有问题,后来一想,咱们这是Win32项目,结果发现在预处理定义里有64位的配置宏:
果断删除
WIN64
再次编译链接成功了!
aaa