This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

WinMain@16 (Was: retired FAQ entries)


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@16'
collect2: ld returned 1 exit status

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

Thanks to Patrick Doyle for bringing this to my attention.

David


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]