簡體   English   中英

將twitcurl庫從VS2010解決方案靜態鏈接到VS2012解決方案的問題

[英]Problems with statically linking twitcurl library from VS2010 solution to VS2012 solution

我在將twitter API twitcurl與我的OpenFrameworks解決方案集成時遇到了麻煩。 Wiki指示聲明將構建的庫靜態鏈接到我的解決方案。 這是我所做的。

我遵循的步驟:

1)下載twitcurl庫並在VS2012上構建它。 解決方案文件基於VS2010,因此我不得不在2012年內對其進行更新。該版本是發行版本。

2)將twitcurl.lib從其發布文件夾靜態鏈接到我的OpenFrameworks解決方案。

這是我嘗試構建它后遇到的錯誤:

1>twitcurl.lib(oauthlib.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>twitcurl.lib(oauthlib.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>twitcurl.lib(twitcurl.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>twitcurl.lib(twitcurl.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>twitcurl.lib(HMAC_SHA1.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>twitcurl.lib(HMAC_SHA1.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>twitcurl.lib(base64.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>twitcurl.lib(base64.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>twitcurl.lib(urlencode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>twitcurl.lib(urlencode.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj

從這些錯誤之后的閱讀中我了解到,在嘗試將發行版本靜態鏈接到調試版本時,通常會觀察到這些錯誤。 隨后,我嘗試了所有其他組合,嘗試以調試模式構建twitcurl,反之亦然。 靜態鏈接庫的調試版本會給我帶來更多錯誤,例如:

1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol __imp__curl_slist_free_all referenced in function "public: bool __thiscall twitCurl::oAuthHandlePIN(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?oAuthHandlePIN@twitCurl@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function "public: __thiscall twitCurl::twitCurl(void)" (??0twitCurl@@QAE@XZ)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol __imp__curl_easy_setopt referenced in function "public: __thiscall twitCurl::twitCurl(void)" (??0twitCurl@@QAE@XZ)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol __imp__curl_easy_perform referenced in function "public: bool __thiscall twitCurl::oAuthHandlePIN(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?oAuthHandlePIN@twitCurl@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function "public: __thiscall twitCurl::~twitCurl(void)" (??1twitCurl@@QAE@XZ)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol __imp__curl_easy_getinfo referenced in function "public: bool __thiscall twitCurl::oAuthHandlePIN(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?oAuthHandlePIN@twitCurl@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>bin\SocialBuildings_debug.exe : fatal error LNK1120: 7 unresolved externals

這是什么原因呢? 以及如何找到解決方法?

非常感謝你的幫助

因此,通過一些更改解決了我的問題:

1)在:解決方案屬性> C / C ++>預處理器>預處理器定義中

組:

_ITERATOR_DEBUG_LEVEL = 2

(試圖先修改實際的dll,但失敗了,損壞的dll)

2)在:解決方案屬性> C / C ++>代碼生成>運行時庫

改成:

多線程DLL

我基本上確保這兩個版本的兩個字段都相同(這就是導致問題的原因)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM