cURL / Mailing Lists / curl-library / Single Mail

curl-library

Linker errors when statically compiled linking libcurl+openssl to my project

From: Oleksiy <patriot_of_ua_at_ukr.net>
Date: Thu, 25 Aug 2011 12:03:53 +0300
('binary' encoding is not supported, stored as-is) ('binary' encoding is not supported, stored as-is)  I am trying to statically link libcurl (with SSL) into my project.
   Downloaded from here -
   http://www.gknw.net/mirror/curl/win32/curl-7.21.7-devel-mingw32.zip
   but I am encountering lots of linker errors:

   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xa9c): undefined
   reference to `CreateDCA_at_16'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaa9): undefined
   reference to `CreateCompatibleDC_at_4'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaba): undefined
   reference to `GetDeviceCaps_at_8'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaca): undefined
   reference to `GetDeviceCaps_at_8'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xae0): undefined
   reference to `CreateCompatibleBitmap_at_12'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaee): undefined
   reference to `SelectObject_at_8'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb00): undefined
   reference to `GetObjectA_at_12'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb71): undefined
   reference to `BitBlt_at_36'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb7b): undefined
   reference to `GetBitmapBits_at_12'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbd2): undefined
   reference to `SelectObject_at_8'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbd9): undefined
   reference to `DeleteObject_at_4'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbe3): undefined
   reference to `DeleteDC_at_4'
   ../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbed): undefined
   reference to `DeleteDC_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x1b3b): undefined reference to
   `inet_addr_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x1ba4): undefined reference to
   `inet_addr_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x5d1e): undefined reference to
   `htonl_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x5eed): undefined reference to
   `ntohl_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x6f9a): undefined reference to
   `htonl_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x728d): undefined reference to
   `htonl_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x732c): undefined reference to
   `htonl_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0x757f): undefined reference to
   `ntohl_at_4'
   ../lib/librtmp.a(rtmp.o):rtmp.c:(.text+0xb45): undefined reference to
   `timeGetTime_at_0'

   Here is the list of files in lib folfer that I downloaded. ![enter
   image description here][3]

   I was told that I should define the macro `CURL_STATICLIB` and link in
   `wsock32` and `wldap32`. Is there anything else that I should be
   doing?

   I am using MinGW and Eclipse.

   g++ -DCURL_STATICLIB -DUSE_LIBSSH2 -DHAVE_LIBSSH2 -DCURL_DISABLE_LDAP
   -DHAVE_LIBSSH2_H -DLIBSSH2_WIN32 -DLIBSSH2_LIBRARY -DUSE_SSLEAY -O0
   -g3 -Wall -c -fmessage-length=0 -osrc\CURLDown.o ..\src\CURLDown.cpp

   g++ -L../lib -oCURLDown.exe src\CURLDown.o -lcurl -lcrypto -lwsock32
   -lwldap32 -leay32 -lidn -lrtmp -lssh2 -lz -lssl32 -lssl

('binary' encoding is not supported, stored as-is) -------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-08-25