最近我試圖鏈接libcurl與dev C++ statically.I鏈接所有的.a文件,除了來自libcurl的libcurldll.a文件和我定義的CURL_STATICLIB。但我收到了一些鏈接器錯誤。然後我搜索谷歌這個鏈接器錯誤的解決方案,我發現應該鏈接「libwsock32.a」。最後我鏈接了libwsock32.a。但我仍然接受不同的連接錯誤......錯誤是一樣....如何靜態鏈接libcurl與dev C++?
[Linker error] undefined reference to `_imp__ldap_set_optionA'
[Linker error] undefined reference to `_imp__ldap_initA'
[Linker error] undefined reference to `_imp__ldap_set_optionA'
[Linker error] undefined reference to `_imp__ldap_simple_bind_sA'
[Linker error] undefined reference to `_imp__ldap_search_sA'
[Linker error] undefined reference to `_imp__ldap_first_entry'
[Linker error] undefined reference to `_imp__ldap_get_dnA'
[Linker error] undefined reference to `_imp__ldap_first_attributeA'
[Linker error] undefined reference to `_imp__ldap_get_values_lenA'
[Linker error] undefined reference to `_imp__ldap_value_free_len'
[Linker error] undefined reference to `_imp__ldap_memfreeA'
[Linker error] undefined reference to `_imp__ldap_next_attributeA'
[Linker error] undefined reference to `_imp__ldap_memfreeA'
[Linker error] undefined reference to `_imp__ldap_next_entry'
[Linker error] undefined reference to `_imp__ldap_err2stringA'
[Linker error] undefined reference to `_imp__ldap_unbind_s'
[Linker error] undefined reference to `_imp__ldap_msgfree'
等等.........
我也搜索在谷歌這個鏈接錯誤但沒有發現。 Plzzzz給了我一個解決方案,爲什麼我收到這個鏈接器錯誤?
請閱讀[dev-C++](http://stackoverflow.com/tags/dev-c%2b%2b/info)的說明,然後使用其他IDE。 – jalf
如果您從源代碼構建curl,則應該具有curl-config實用程序。使用--libs標誌運行它,以獲得需要鏈接到必要依賴關係的編譯器開關。 – jeffmagill