perllinkeraixperl-module

Undefined symbol building WWW::Curl::Easy Perl module on AIX 5.3


I'm trying to get the WWW::Curl::Easy Perl module installed on AIX 5.3. I have curl installed (from source) in /usr/local. When trying to build the Perl module, I get this:

$ perl Makefile.PL
Found curl.h in /usr/local/include/curl/curl.h
Building curlopt-constants.c for your libcurl version
Building Easy.pm constants for your libcurl version
Note (probably harmless): No library found for -lcurl
Writing Makefile for WWW::Curl

I'm thinking the "probably harmless" error is not so harmless.

$ make
Skip blib/lib/WWW/Curl/Form.pm (unchanged)
Skip blib/lib/WWW/Curl.pm (unchanged)
Skip blib/lib/WWW/Curl/Multi.pm (unchanged)
Skip blib/lib/WWW/Curl/Easy.pm (unchanged)
        cc_r -c  -I/usr/local/include  -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong -O    -DVERSION=\"3.02\"  -DXS_VERSION=\"3.02\"  "-I/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE"   Curl.c
"Curl.xs", line 681.36: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed.
Running Mkbootstrap for WWW::Curl ()
        chmod 644 Curl.bs
        rm -f blib/arch/auto/WWW/Curl/Curl.so
        ld  -bhalt:4 -bM:SRE -bI:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp -bE:Curl.exp -bnoentry -lpthreads -lc_r Curl.o  -o blib/arch/auto/WWW/Curl/Curl.so              
ld: 0711-317 ERROR: Undefined symbol: .curl_global_init
ld: 0711-317 ERROR: Undefined symbol: .curl_multi_perform
ld: 0711-317 ERROR: Undefined symbol: .curl_multi_fdset
ld: 0711-317 ERROR: Undefined symbol: .curl_multi_remove_handle
ld: 0711-317 ERROR: Undefined symbol: .curl_multi_add_handle
ld: 0711-317 ERROR: Undefined symbol: .curl_global_cleanup
ld: 0711-317 ERROR: Undefined symbol: .curl_easy_getinfo
ld: 0711-317 ERROR: Undefined symbol: .curl_easy_perform
ld: 0711-317 ERROR: Undefined symbol: .curl_slist_free_all
ld: 0711-317 ERROR: Undefined symbol: .curl_slist_append
ld: 0711-317 ERROR: Undefined symbol: .curl_easy_setopt
ld: 0711-317 ERROR: Undefined symbol: .curl_version
ld: 0711-317 ERROR: Undefined symbol: .curl_multi_cleanup
ld: 0711-317 ERROR: Undefined symbol: .curl_multi_init
ld: 0711-317 ERROR: Undefined symbol: .curl_easy_cleanup
ld: 0711-317 ERROR: Undefined symbol: .curl_easy_duphandle
ld: 0711-317 ERROR: Undefined symbol: .curl_easy_init
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make: The error code from the last command is 8.


Stop.

I suspect this is a fairly simple thing for someone familiar with C compilers and linkers. Appreciate any help.


Solution

  • It looks like the linker arguments for libcurl are missing from the ld line. That's the output of curl-config --libs and should look something like -L/opt/local/lib -lcurl. Make sure /opt/local/lib/libcurl.so exists (where /opt/local/lib is whatever comes after -L).

    You may have the libcurl headers but not the shared library.