0
我想獲得一個第三方庫來處理我的代碼。我有源代碼庫,並且已經驗證了構建選項與我自己的構建選項相匹配,但我並沒有通過所有的源代碼來了解它在做什麼。如何解決.lib文件中方法的差異?
我的代碼調用,給了我下面的鏈接錯誤行Value m_jsonValRoot;
:
Linking...
1>JsonWrapper.obj : error LNK2019: unresolved external symbol "public: __cdecl Json::Value::~Value(void)" ([email protected]@@[email protected]) referenced in function "public: class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsOS<wchar_t> > > __cdecl Json::CJsonWrapper::RunTest(class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsOS<wchar_t> > >)" ([email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@@@[email protected]@[email protected]@Z)
1>JsonWrapper.obj : error LNK2019: unresolved external symbol "public: __cdecl Json::Value::Value(int)" ([email protected]@@[email protected]@Z) referenced in function "public: class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsOS<wchar_t> > > __cdecl Json::CJsonWrapper::RunTest(class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsOS<wchar_t> > >)" ([email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@@@[email protected]@[email protected]@Z)
1>Windows Mobile 6.5.3 Standard DTK (ARMV4I)\Debug\CCRDEX_UI.exe : fatal error LNK1120: 2 unresolved externals
我跑DUMPBIN上的.lib文件,我發現我的功能被定義爲:
SECTION HEADER #C7
.text name
0 physical address
0 virtual address
194 size of raw data
22345 file pointer to raw data (00022345 to 000224D8)
224D9 file pointer to relocation table
0 file pointer to line numbers
12 number of relocations
0 number of line numbers
60501020 flags
Code
COMDAT; sym= "public: __thiscall Json::Value::Value(enum Json::ValueType)" ([email protected]@@[email protected]@[email protected]@Z)
16 byte align
Execute Read
我試圖通過將headder文件中的方法聲明從Value(ValueType type = nullValue);
更改爲__thiscall Value(ValueType type = nullValue);
來解決此問題,但這對連接器沒有影響。
我建立在共享DLL中使用MFC,使用Unicode Visual Studio 2008中的一個項目,並正在構建的Windows Mobile 6.5.3
我可以採取什麼步驟來reslove鏈接的問題?
不要編輯標題,只是挖掘你一個更深的洞。改爲關注缺少的析構函數。你沒有提供任何證據表明你實際上在鏈接這個圖書館。這是簡單的解釋。 –
這只是一個希望解決它的測試......當它沒有影響時,我解開了它。 我放置在頭文件項目中的直接,我也包括在「額外包含目錄」 所述的.lib文件下包括在路徑「附加依賴」 – Mike
我已經證實,被.LIB(WAS)正確鏈接。我篡改了它,並得到了一個不同的錯誤'LINK:致命錯誤LNK1181:無法打開輸入文件'json_debug_vc90_libmtd.lib''...所以我知道它是原始鏈接到lib – Mike