cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: undefined symbols, cross compile

From: Tor Arntsen <tor_at_spacetec.no>
Date: Mon, 14 Feb 2011 10:31:18 +0100

On Sun, Feb 13, 2011 at 21:55, Olav <curl_at_benumweb.com> wrote:
> I am doing a cross-compile,  and I'm getting some undefined symbols.
>
> I would like to have some idea about how I can troubleshoot this.
> I am not sure how I can be sure I am picking up the right include-files and
> libaries etc:
> export CC=arm-linux-g++
> export CXX=arm-linux-g++
> export LDFLAGS="-lrt"
> ./configure --host=arm-linux-uclibcgnueabi ---target=arm-linux-uclibcgnueabi
> -disable-shared --disable-thread
>
> *************
> make[2]: Entering directory `/home/max/curl-7.21.3/src'
> /bin/sh ../libtool --tag=CC   --mode=link arm-linux-gcc  -g0 -O2
> -Wno-system-headers   -lrt -o curl main.o hugehelp.o urlglob.o writeout.o
> writeenv.o getpass.o homedir.o curlutil.o os-specific.o xattr.o strtoofft.o
> strdup.o rawstr.o nonblock.o  ../lib/libcurl.la -lz
> libtool: link: arm-linux-gcc -g0 -O2 -Wno-system-headers -o curl main.o
> hugehelp.o urlglob.o writeout.o writeenv.o getpass.o homedir.o curlutil.o
> os-specific.o xattr.o strtoofft.o strdup.o rawstr.o nonblock.o
> ../lib/.libs/libcurl.a -lrt -lz
> main.o: In function `GetStr':
> main.c:(.text+0x194): undefined reference to `__strdup'
[..]

It looks like your cross-compiler doesn't automatically link with the
runtime library. Try adding -lc after -lrt -lz

-Tor
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-14