天天看點

VS+QT+ACE_TAO+OpenDDS使用連結中出現的問題

使用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位的配置宏:

VS+QT+ACE_TAO+OpenDDS使用連結中出現的問題

果斷删除

WIN64

再次編譯連結成功了!

aaa

繼續閱讀