delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/12/10:58:51

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Tue, 12 Dec 2000 15:57:38 +0000
Message-ID: <8400-Tue12Dec2000155738+0000-starksb@ebi.ac.uk>
X-Mailer: emacs 20.7.1 (via feedmail 9-beta-7 I);
VM 6.75 under Emacs 20.7.1
From: David Starks-Browning <starksb AT ebi DOT ac DOT uk>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: WinMain AT 16 (Was: retired FAQ entries)
In-Reply-To: <2593-Tue12Dec2000132202+0000-starksb@ebi.ac.uk>
References: <2593-Tue12Dec2000132202+0000-starksb AT ebi DOT ac DOT uk>

On Tuesday 12 Dec 00, David Starks-Browning writes:
> The following were in the FAQ as "Known/potential Problems in the
> Latest Net Release":
> 
> Linking with -lm or -lc leads to crash

Perhaps I spoke to soon.  Although linking with -lm no longer crashes,
one does have to be careful about where to put it:

bash$ gcc hello.c -lm

bash$ ./a.exe
Hello World!

bash$  gcc -lm hello.c
/c/TEMP/ccjLEGlU.o(.text+0x10):hello.c: multiple definition of `main'
/usr/lib/libm.a(libcmain.o)(.text+0x0):libcmain.c: first defined here
/usr/lib/libm.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference to `WinMain AT 16'
collect2: ld returned 1 exit status

This is not in the FAQ anywhere.  I'll add it to the existing section
about WinMain AT 16.

Thanks to Patrick Doyle for bringing this to my attention.

David


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019