cURL / Mailing Lists / curl-users / Single Mail

curl-users

_WinMain@16 link error on cygwin

From: Roth, Kevin P. <KPRoth_at_MarathonOil.com>
Date: Tue, 14 Jan 2003 21:17:56 -0500

Daniel:

What version of aclocal do you use when building release tarballs
for curl? After digging a bit today, I finally found the minimal
solution needed on my build system for cygwin compatibility. I
had to rerun aclocal and autoconf, to recreate configure and
aclocal.m4 (which in turn permits libtool to be recreated).

(If you'll recall, I started getting an error during building,
unless I first did a ./reconf, after you updated to newer
autotools...)

I'm using "aclocal (GNU automake) 1.7.2". I think it's not been
customized much (if at all) by the cygwin crew when they packaged
it.

Could you take a quick look at the notes below, and consider
whether updating your copy of automake/aclocal may help fix
the problem, or whether I'm going to have to continue re-confing
the cygwin builds?

I found that an unsuccessful build had a libtool script which
tried running the following link command on libcurl:

  gcc -Wl,--base-file,.libs/cygcurl-2.dll-base \
  -Wl,-e,__cygwin_dll_entry_at_12 -o .libs/cygcurl-2.dll \
  *.lo -lz -lssl -lcrypto -lz

which generated the following error:

  /usr/lib/...../libcygwin.a(libcmain.o)(.text+0x7c):
  undefined reference to `_WinMain_at_16'

A successful build (after a reconf) used a rather different-
looking link command:

  gcc -shared *.lo -lz -lssl -lcrypto -lz -o .libs/cygcurl-2.dll \
  -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libcurl.dll.a

In both cases libtool was called like this:

  /bin/bash ../libtool --mode=link gcc -g -O2 -o libcurl.la \
  -rpath /usr/lib -no-undefined -version-info 2:2:0 *.lo \
  -lz -lssl -lcrypto -lz

[for all of the above, *.lo was actually a long list of .lo files]

I've can send separate a diff file with all of the differences (78k)
if it would be any help...

Thanks,
--Kevin

-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving
your online business a competitive advantage. Test-drive a Thawte SSL
certificate - our easy online guide will show you how. Click here to get
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
Received on 2003-01-15