curl-library
Cross-compiling linux to windows and OpenSSL
Date: Sun, 28 Dec 2014 19:52:41 +0100
Hi everybody,
I'm on ubuntu 14.04 64 bits, and I'm trying to cross compile libcurl as a
static library with OpenSSL to windows 64bits using mingw32, but I get an
error.
First I cross compile statically OpenSSL 1.0.1j :
cd openssl-1.0.1j/
export CROSS_COMPILE="x86_64-w64-mingw32-"
./Configure mingw64 no-asm no-shared
make depend
make && sudo make install
Then I try to cross compile statically libcurl :
cd curl-7.39.0/
export LDFLAGS="-L/usr/local/ssl/lib"
export CPPFLAGS="-I/usr/local/ssl/include"
./configure --host=x86_64-w64-mingw32 --disable-shared --disable-ldap
--without-librtmp --with-ssl=/usr/local/ssl
make
And then I get the error. It looks related to openssl and indeed if I
disable openssl then libcurl compiles correctly. The error:
libtool: link: x86_64-w64-mingw32-gcc -O2 -Wno-system-headers -o curl.exe
curl-tool_binmode.o curl-tool_bname.o curl-tool_cb_dbg.o curl-tool_cb_hdr.o
curl-tool_cb_prg.o curl-tool_cb_rea.o curl-tool_cb_see.o curl-tool_cb_wrt.o
curl-tool_cfgable.o curl-tool_convert.o curl-tool_dirhie.o
curl-tool_doswin.o curl-tool_easysrc.o curl-tool_formparse.o
curl-tool_getparam.o curl-tool_getpass.o curl-tool_help.o
curl-tool_helpers.o curl-tool_homedir.o curl-tool_hugehelp.o
curl-tool_libinfo.o curl-tool_main.o curl-tool_metalink.o
curl-tool_mfiles.o curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o
curl-tool_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o
curl-tool_strdup.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_urlglob.o
curl-tool_util.o curl-tool_vms.o curl-tool_writeenv.o curl-tool_writeout.o
curl-tool_xattr.o ../lib/curl-strtoofft.o ../lib/curl-rawstr.o
../lib/curl-nonblock.o ../lib/curl-warnless.o -L/usr/local/ssl/lib
../lib/.libs/libcurl.a -lgdi32 -lssl -lcrypto -lws2_32
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xd26):
undefined reference to `__imp_CreateDCW'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xd32):
undefined reference to `__imp_CreateCompatibleDC'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xd39):
undefined reference to `__imp_GetDeviceCaps'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xd67):
undefined reference to `__imp_CreateCompatibleBitmap'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xd74):
undefined reference to `__imp_SelectObject'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xd99):
undefined reference to `__imp_GetObjectW'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xe38):
undefined reference to `__imp_BitBlt'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xe46):
undefined reference to `__imp_GetBitmapBits'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xea8):
undefined reference to `__imp_DeleteObject'
/usr/local/ssl/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xeb2):
undefined reference to `__imp_DeleteDC'
/usr/bin/x86_64-w64-mingw32-ld: /usr/local/ssl/lib/libcrypto.a(rand_win.o):
bad reloc address 0x0 in section `.pdata'
Can anyone shed some light into this subject?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-28