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

How to statically link libcurl with dev c++?

本文关键字:libcurl dev c++ 链接 何静态 静态      更新时间:2023-10-16

最近我正在尝试静态链接libcurl与dev c++。我链接了所有。a文件,除了libcurllll。一个来自libcurl的文件,我定义了CURL_STATICLIB。但是我收到了一些链接错误。然后我在谷歌上搜索这个链接器错误的解决方案,在那里我发现了"libwsock32. exe"。"应该连起来。最后我链接了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' 

等等.........

我也搜索了这个链接错误在谷歌,但没有发现。Plzzzz给我一个解决方案,为什么我收到这个链接错误????

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

看起来您需要与ldap链接。您还应该考虑不使用dev - c++,而使用积极开发的高质量IDE,如Eclipse CDT