curl-library
Re: Trying to cross compile libcurl with MinGW 32-bit from Ubuntu, for Win32 Executables
Date: Sat, 15 Feb 2014 20:09:51 -0500
On Sat, 15 Feb 2014 16:55:59 +0100 (CET), Daniel Stenberg <daniel_at_haxx.se>
wrote:
> I would imagine that you'd build libcurl exactly the same, no matter
which
> mingw version you use...
>
This is what is happening:
$ PATH=$PATH:/path/to/mingw32/bin ./configure --host=i686-w64-mingw32
--with-zlib=/path/to/mingw32 --prefix=/path/to/mingw32 --enable-static
--enable-shared
...
curl version: 7.35.0
Host setup: i686-w64-mingw32
Install prefix: /path/to/mingw32
Compiler: i686-w64-mingw32-gcc
SSL support: enabled (OpenSSL)
SSH support: no (--with-libssh2)
zlib support: enabled
GSSAPI support: no (--with-gssapi)
SPNEGO support: no (--with-spnego)
TLS-SRP support: no (--enable-tls-srp)
resolver: default (--enable-ares / --enable-threaded-resolver)
ipv6 support: no (--enable-ipv6)
IDN support: no (--with-{libidn,winidn})
Build libcurl: Shared=yes, Static=no
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
SSPI support: no (--enable-sspi)
ca cert bundle: /etc/ssl/certs/ca-certificates.crt
ca cert path: no
LDAP support: enabled (winldap)
LDAPS support: enabled
RTSP support: enabled
RTMP support: no (--with-librtmp)
metalink support: no (--with-libmetalink)
HTTP2 support: disabled (--with-nghttp2)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP
LDAPS POP3 POP3S RTSP SMTP SMTPS TELNET TFTP
$ PATH=$PATH:/path/to/mingw32/bin make
...
/bin/bash ../libtool --tag=CC --mode=link i686-w64-mingw32-gcc -O2
-Wno-system-headers -L/path/to/mingw32/lib -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_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-strdup.o ../lib/curl-rawstr.o
../lib/curl-nonblock.o ../lib/libcurl.la -lssl -lcrypto -lgdi32 -lssl
-lcrypto -lwldap32 -lz -lws2_32
libtool: link: i686-w64-mingw32-gcc -O2 -Wno-system-headers -o
.libs/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_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-strdup.o ../lib/curl-rawstr.o
../lib/curl-nonblock.o -L/path/to/mingw32/lib ../lib/.libs/libcurl.a
-lgdi32 -lssl -lcrypto -lwldap32 -lz -lws2_32
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x5e): undefined reference to
`_imp__curl_strequal'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x117): undefined reference to
`_imp__curl_msnprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x16d): undefined reference to
`_imp__curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x30b): undefined reference to
`_imp__curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x3f4): undefined reference to
`_imp__curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x476): undefined reference to
`_imp__curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x600): undefined reference to
`_imp__curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x667): more undefined references
to `_imp__curl_mfprintf' follow
/path/to/mingw32/lib/gcc/i686-w64-mingw32/4.8.3/../../../../i686-w64-mingw32/bin/ld:
curl-tool_cb_dbg.o: bad reloc address 0xec in section `.rdata'
collect2: error: ld returned 1 exit status
make[2]: *** [curl.exe] Error 1
make[2]: Leaving directory `/path/to/source/curl-7.35.0/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/path/to/source/curl-7.35.0/src'
make: *** [all-recursive] Error 1
One things I noticed off the bat is I specifically enabled both static and
dynamic libraries, yet configure only enables dynamic. I get the same
configure result if I don't specify anything.
This is Ubuntu x86_64 3.2.0-58-generic cross-compiling for MinGW x86.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-02-16