如何将libcurl与dev c ++静态链接?

时间:2011-08-17 08:17:48

标签: c++ libcurl static-linking

最近我试图将libcurl与dev c ++静态链接。我链接了所有的.a文件,除了来自libcurl的libcurldll.a文件,我定义了CURL_STATICLIB。但是我收到了一些链接器错误。然后我搜索谷歌搜索此链接器错误的解决方案,在那里我发现应该链接“libwsock32.a”。最后我链接了libwsock32.a。但我仍然收到不同的链接器错误......错误就像....

[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' 

等等.........

我还在google中搜索了这个链接器错误,但没有找到。 Plzzzz给我一个解决方案,为什么我收到这个链接器错误????

2 个答案:

答案 0 :(得分:2)

对于Windows和Mingw gcc或g ++,请添加   libwldap32.a 到链接器, 从字面上看它是一个  的 -lwldap32 链接器选项。

答案 1 :(得分:0)

您似乎需要与ldap相关联。您还应考虑不使用Dev-C ++,并使用积极开发的高质量IDE,如Eclipse CDT