curl-library
Re: Compiling on MingW32 without a DLL
From: Matthew \ <tragic.descent_at_gmail.com>
Date: Mon, 20 Feb 2006 15:44:31 -0500
Date: Mon, 20 Feb 2006 15:44:31 -0500
> ./configure --disable-shared doesn't work?
No :(
Actually its a bit more difficult than that... attempting to cross
compile the library as a static is prooving dificult. After more
thoroughly reading the documentation on cross compiling and about the
lib as well as using --disable-shared I went back and modified
makefiles and configured accordingly, but to no avail. When I compile, I
get an error while compiling curl.exe, but that's no big deal since what
I care about is the library, I look in lib/.libs/ and find a
libcurl.a. When I compile my program and run it, it still complains
about not locating the dll file.
--- Okay scratch the above, I have figured out some things, first, I have multiple directories for my cross compiler libs and that I have multiple copies of libcurl.a lying around (no doubt caused by my many attempts at getting a cross compiler working). After resolving that I found another problem (will this helpless noob feeling ever end?), ------------- i586-mingw32msvc-g++ baf-0.6.cc -o baf-6.exe -lcurl results in approximately 400 lines similiar to the following: /tmp/fakeroot/curl-7.15.1/lib/transfer.c:2226: undefined reference to `__imp__curl_easy_strerror' /tmp/fakeroot/curl-7.15.1/lib/transfer.c:2184: undefined reference to `_closesocket_at_4' /usr/lib/gcc/i586-mingw32msvc/3.4.2/libcurl.a(hostip.o): In function `create_hostcache_id': /tmp/fakeroot/curl-7.15.1/lib/hostip.c:204: undefined reference to `__imp__curl_maprintf' /usr/lib/gcc/i586-mingw32msvc/3.4.2/libcurl.a(sslgen.o): In function `safe_strequal': where as «[zashi_at_solidus:baf]» i586-mingw32msvc-g++ -l curl baf-0.6.cc -o baf-6.exe /tmp/ccowUeJt.o:baf-0.6.cc:(.text+0x432): undefined reference to `_curl_global_init' /tmp/ccowUeJt.o:baf-0.6.cc:(.text+0x43a): undefined reference to `_curl_easy_init' /tmp/ccowUeJt.o:baf-0.6.cc:(.text+0x450): undefined reference to `_curl_easy_setopt' /tmp/ccowUeJt.o:baf-0.6.cc:(.text+0x468): undefined reference to `_curl_easy_setopt' /tmp/ccowUeJt.o:baf-0.6.cc:(.text+0x54b): undefined reference to `_curl_easy_setopt' /tmp/ccowUeJt.o:baf-0.6.cc:(.text+0x559): undefined reference to `_curl_easy_perform' collect2: ld returned 1 exit status ----------- I'm pretty sure I've compiled the library as static, and know for sure now that I'm referencing the right lib with -lcurl .... My best guess is I compiled the library wrong, or I'm linking wrong. ~ZashiReceived on 2006-02-20