如何将 libcurl 与 dev c++ 静态链接?
最近我尝试将 libcurl 与 dev c++ 静态链接。我链接了除来自 libcurl 的 libcurldll.a 文件之外的所有 .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'
等等.........
我还在谷歌中搜索了此链接器错误,但没有找到。请给我一个解决方案,为什么我收到此链接器错误???
Recently I am trying to link libcurl with dev c++ statically.I linked all the .a files except libcurldll.a file which came from libcurl and I defined CURL_STATICLIB . But I received some linker errors. Then I searched google for the solution of this linker error, there I found that "libwsock32.a" should be linked. And finally I linked libwsock32.a. But I am still receiving different linker errors... Errors are like....
[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'
And so on.........
I also searched for this linker errors in google but nothing found. Plzzzz give me a solution why I am receiving this linker errors????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 Windows 和 Mingw gcc 或 g++,添加
libwldap32.a 到链接器,
从字面上看,它是一个
-lwldap32
链接器选项。
For Windows and Mingw gcc or g++, add
libwldap32.a to linker,
literally it is a
-lwldap32
linker option.
看起来您需要链接到 ldap。您还应该考虑不使用 Dev-C++,而使用积极开发的高质量 IDE,例如 Eclipse CDT
Looks like you need to link with ldap. You should also consider not using Dev-C++, and use an actively developed, high quality IDE like Eclipse CDT