Compiling error with libcurl

Hi all
When trying to run make-all-linux-project.sh with the latest release (both from git and from the website) I get errors about undefined references. Here is the complete message.

/home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-url.o): In function `Curl_disconnect': url.c:(.text+0xd09): undefined reference to `idn_free' url.c:(.text+0xd1b): undefined reference to `idn_free' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-url.o): In function `fix_hostname': url.c:(.text.unlikely+0x71): undefined reference to `stringprep_check_version' url.c:(.text.unlikely+0x9c): undefined reference to `idna_to_ascii_lz' url.c:(.text.unlikely+0xa3): undefined reference to `stringprep_locale_charset' url.c:(.text.unlikely+0x10b): undefined reference to `idna_to_unicode_lzlz' url.c:(.text.unlikely+0x12f): undefined reference to `tld_check_lz' url.c:(.text.unlikely+0x13d): undefined reference to `tld_strerror' url.c:(.text.unlikely+0x199): undefined reference to `idn_free' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-strerror.o): In function `Curl_idn_strerror': strerror.c:(.text+0x149): undefined reference to `idna_strerror' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-curl_rtmp.o): In function `rtmp_disconnect': curl_rtmp.c:(.text+0x30): undefined reference to `RTMP_Close' curl_rtmp.c:(.text+0x38): undefined reference to `RTMP_Free' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-curl_rtmp.o): In function `rtmp_connect': curl_rtmp.c:(.text+0xeb): undefined reference to `RTMP_Connect1' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-curl_rtmp.o): In function `rtmp_send': curl_rtmp.c:(.text+0x161): undefined reference to `RTMP_Write' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-curl_rtmp.o): In function `rtmp_setup': curl_rtmp.c:(.text+0x190): undefined reference to `RTMP_Alloc' curl_rtmp.c:(.text+0x1a3): undefined reference to `RTMP_Init' curl_rtmp.c:(.text+0x1b3): undefined reference to `RTMP_SetBufferMS' curl_rtmp.c:(.text+0x1c7): undefined reference to `RTMP_SetupURL' curl_rtmp.c:(.text+0x1ec): undefined reference to `RTMP_Free' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-curl_rtmp.o): In function `rtmp_recv': curl_rtmp.c:(.text+0x239): undefined reference to `RTMP_Read' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-curl_rtmp.o): In function `rtmp_do': curl_rtmp.c:(.text+0x2c5): undefined reference to `RTMP_ConnectStream' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-openldap.o): In function `ldap_disconnect': openldap.c:(.text+0x33): undefined reference to `ldap_unbind_ext' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-openldap.o): In function `ldap_connecting': openldap.c:(.text+0x105): undefined reference to `ldap_sasl_bind' openldap.c:(.text+0x13e): undefined reference to `ldap_result' openldap.c:(.text+0x18f): undefined reference to `ldap_parse_result' openldap.c:(.text+0x1be): undefined reference to `ldap_get_option' openldap.c:(.text+0x1d5): undefined reference to `ldap_memfree' openldap.c:(.text+0x1fb): undefined reference to `ldap_set_option' openldap.c:(.text+0x23c): undefined reference to `ldap_memfree' openldap.c:(.text+0x286): undefined reference to `ldap_err2string' openldap.c:(.text+0x2bb): undefined reference to `ldap_memfree' openldap.c:(.text+0x2d4): undefined reference to `ldap_err2string' openldap.c:(.text+0x304): undefined reference to `ldap_err2string' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-openldap.o): In function `ldap_recv': openldap.c:(.text+0x3ad): undefined reference to `ldap_result' openldap.c:(.text+0x3e0): undefined reference to `ldap_first_message' openldap.c:(.text+0x40a): undefined reference to `ldap_next_message' openldap.c:(.text+0x422): undefined reference to `ldap_msgtype' openldap.c:(.text+0x45e): undefined reference to `ldap_get_dn_ber' openldap.c:(.text+0x503): undefined reference to `ldap_get_attribute_ber' openldap.c:(.text+0x7b4): undefined reference to `ber_memfree' openldap.c:(.text+0x807): undefined reference to `ber_memfree' openldap.c:(.text+0x81b): undefined reference to `ber_free' openldap.c:(.text+0x827): undefined reference to `ldap_msgfree' openldap.c:(.text+0x84b): undefined reference to `ldap_msgfree' openldap.c:(.text+0x8a3): undefined reference to `ldap_parse_result' openldap.c:(.text+0x8d2): undefined reference to `ldap_err2string' openldap.c:(.text+0x934): undefined reference to `ldap_memfree' openldap.c:(.text+0x975): undefined reference to `ber_free' openldap.c:(.text+0x9a2): undefined reference to `ldap_err2string' openldap.c:(.text+0x9f6): undefined reference to `ldap_err2string' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-openldap.o): In function `ldap_done': openldap.c:(.text+0xa98): undefined reference to `ldap_abandon_ext' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-openldap.o): In function `ldap_do': openldap.c:(.text+0xafd): undefined reference to `ldap_url_parse' openldap.c:(.text+0xba6): undefined reference to `ldap_search_ext' openldap.c:(.text+0xbb4): undefined reference to `ldap_free_urldesc' openldap.c:(.text+0xbc0): undefined reference to `ldap_err2string' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-openldap.o): In function `ldap_setup': openldap.c:(.text+0xc7d): undefined reference to `ldap_url_parse' openldap.c:(.text+0xcdb): undefined reference to `ldap_pvt_url_scheme2proto' openldap.c:(.text+0xce9): undefined reference to `ldap_free_urldesc' /home/raf/cocos2d-x/cocos2dx/platform/third_party/linux/libraries/libcurl.a(libcurl_la-openldap.o): In function `ldap_connect': openldap.c:(.text+0xde9): undefined reference to `ldap_init_fd' openldap.c:(.text+0xdf5): undefined reference to `ldap_err2string' openldap.c:(.text+0xe66): undefined reference to `ldap_set_option' collect2: error: ld returned 1 exit status make[1]: *** [bin/debug/TestCpp] Error 1 make[1]: Leaving directory `/home/raf/cocos2d-x/samples/Cpp/TestCpp/proj.linux' make: *** [all] Error 2

I’m using ubuntu, and I have installed the packages listed on the wiki page: libgl1-mesa-dev libglfw-dev freeglut3-dev libzip-dev.
If I download an earlier version: cocos2d-2.1beta3-x-2.1.1.zip, from 28 January, there is no problem.

Does someone know how to fix this? Should I really fix it, or ignore it, or just use the earlier version?

Best regard,


Raphaël Payen

The same error on Ubuntu 12.10 32b with cocos2d-2.1rc0-x-2.1.2-hotfix.zip @ Apr.08, 2013.
I’ve just spent about 3 hours on resolving this issue and I am blocked too, so I am connecting to this topic!
Best Regards,

If you want to fix it just add this line to

cocos_dir/samples/Cpp/TestCpp/proj.linux/Makefile

SHAREDLIBS = lcocos2dlcocosdenshion ~~lcurl
~~lcurl is missing

It works! Thanks.