I'm trying to use native client (pNaCl) with the curl library from naclports. I have NaCl SDK version 38 and I'm using the pepper_38 branch of naclports. After successfully building the curl library, I included the header in my project and executed "make" with the pnacl toolchain. If only the header is included all goes well, but as soon as I try to use a curl function from the library, I get a ton of "undefined reference" errors inside that library:
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'sigaction'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'recv'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'getsockname'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'bind'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'getsockopt'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'socket'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'connect'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'htons'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'getpeername'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'inet_pton'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'ntohs'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'inet_ntop'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'setsockopt'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'poll'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'send'
/nacl_sdk/pepper_38/toolchain/linux_pnacl/usr/local/lib/libcurl.a: error: undefined reference to 'inflate'
I'm completely new to NaCl, so any tips would be very helpful.
So I finally managed to compile my project. In the end it came down to the order in which the libraries were linked. The working order turned out to be the following: ppapi_cpp ppapi pthread curl ssl crypto z nacl_io. The first 3 were already in the sample project, the others were added.