cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: weird c-ares cross-compiled linking problem

From: Gisle Vanem <giva_at_bgnett.no>
Date: Mon, 14 Mar 2005 10:13:46 +0100

"Daniel Stenberg" wrote:

> i586-mingw32msvc-gcc -I/openssl-0.9.7e/include -Iwin32-zlib/include -o
> curl.exe main.o hugehelp.o urlglob.o writeout.o writeenv.o getpass.o homedir.o
> strtoofft.o timeval.o -Lcurl-buildwin -Lcurl-buildwin/ares
> ../lib/.libs/libcurl.a -lssl -lgdi32 -lcrypto -lwinmm -lws2_32 -lz
> ares/.libs/libcares.a
>
> ares/.libs/libcares.a(ares_init.o):ares_init.c:(.text+0xe5a):
> undefined reference to `_htonl_at_4'
> ares/.libs/libcares.a(ares_init.o):ares_init.c:(.text+0xe8a):
> undefined reference to `_gethostname_at_8'
> ares/.libs/libcares.a(ares_init.o):ares_init.c:(.text+0x18c5):
> undefined reference to `_ntohl_at_4'

Simple; the order of libraries is important. Try putting
-lws2_32 after libares.a.

--gv
Received on 2005-03-14