curl-library
Re: Problem linking on mingw
Date: Mon, 4 Feb 2013 15:55:15 -0800
You probably need to define proper linkage for the function in the header
file. It is:
int Curl_inet_pton(int, const char *, void *);
and you'd want
CURL_EXTERN int Curl_inet_pton(int, const char *, void *);
so that the symbol is externalized properly.
YA
ญญญ
Learn about GPT services and architectures on Confluence.
<http://confluence/display/GPT/GPT+Architecture>
On 2/4/13 2:05 PM, "Ben Greear" <greearb_at_candelatech.com> wrote:
>I patched the curl tool to allow some new commands, some of which
>required Curl_inet_pton.
>
>This links fine on Linux, but when compiling with mingw (on linux),
>I'm getting the linking problem below.
>
>If I manually add: ../lib/.libs/libcurl_la-inet_pton.o to the link
>objects,
>then it links fine.
>
>Any idea on how to fix this properly?
>
>/bin/sh ../libtool --tag=CC --mode=link i686-w64-mingw32-gcc -O2
>-Wno-system-headers
>-L/home/greearb/git/mingw/btbits/3plibs/OpenSSL-Install/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 curl-strtoofft.o curl-strdup.o
>curl-rawstr.o
>curl-nonblock.o ../lib/libcurl.la -lssl -lcrypto -lgdi32 -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 curl-strtoofft.o curl-strdup.o
>curl-rawstr.o curl-nonblock.o
>-L/home/greearb/git/mingw/btbits/3plibs/OpenSSL-Install/lib
>../lib/.libs/libcurl.dll.a -lssl -lcrypto -lgdi32 -lwldap32 -lz -lws2_32
>-L/usr/local/lib
>curl-tool_operate.o:tool_operate.c:(.text+0x2108): undefined reference to
>`Curl_inet_pton'
>curl-tool_operate.o:tool_operate.c:(.text+0x2192): undefined reference to
>`Curl_inet_pton'
>/usr/lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld:
>curl-tool_operate.o: bad reloc address 0x11b0 in section `.rdata'
>/usr/lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld:
>final link failed: Invalid operation
>collect2: error: ld returned 1 exit status
>make[3]: *** [curl.exe] Error 1
>make[3]: Leaving directory
>`/home/greearb/git/mingw/btbits/l4libs/curl-git/src'
>make[2]: *** [all] Error 2
>make[2]: Leaving directory
>`/home/greearb/git/mingw/btbits/l4libs/curl-git/src'
>make[1]: *** [all-recursive] Error 1
>
>
>Thanks,
>Ben
>
>--
>Ben Greear <greearb_at_candelatech.com>
>Candela Technologies Inc http://www.candelatech.com
>
>-------------------------------------------------------------------
>List admin: http://cool.haxx.se/list/listinfo/curl-library
>Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-05