diff options
author | David Starks-Browning <starksb@ebi.ac.uk> | 2000-12-12 16:05:30 +0000 |
---|---|---|
committer | David Starks-Browning <starksb@ebi.ac.uk> | 2000-12-12 16:05:30 +0000 |
commit | 5c8836b9166c412580ca33ffd81df406d5291633 (patch) | |
tree | 9cb23fb136906d649b14ed856ff1aea5237a471c /winsup/doc/how-programming.texinfo | |
parent | 9972a88b3f349bc6e19b75521c7fd14da812485b (diff) | |
download | newlib-5c8836b9166c412580ca33ffd81df406d5291633.zip newlib-5c8836b9166c412580ca33ffd81df406d5291633.tar.gz newlib-5c8836b9166c412580ca33ffd81df406d5291633.tar.bz2 |
add tip about -lm order to WinMail@16 entry
Diffstat (limited to 'winsup/doc/how-programming.texinfo')
-rw-r--r-- | winsup/doc/how-programming.texinfo | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/winsup/doc/how-programming.texinfo b/winsup/doc/how-programming.texinfo index 4045900..6b30463 100644 --- a/winsup/doc/how-programming.texinfo +++ b/winsup/doc/how-programming.texinfo @@ -44,13 +44,31 @@ MAKE_MODE to "UNIX" (actually case is not significant) or "WIN32" (actually anything other than "UNIX"). You can also specify the options --unix or --win32 on the make command line. -@subsection Why the undefined reference to "WinMain@@16"? - -@strong{(Please note: This section has not yet been updated for the latest -net release.)} +@subsection Why the undefined reference to @samp{WinMain@@16}? Try adding an empty main() function to one of your sources. +Or, perhaps you have @samp{-lm} too early in the link command line. It +should be at the end: + +@example + bash$ gcc hello.c -lm + bash$ ./a.exe + Hello World! +@end example + +works, but + +@example + 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 +@end example + +This is an artifact of libm.a being a symbolic link to libcygwin.a. + @subsection How do I use Win32 API calls? @strong{(Please note: This section has not yet been updated for the latest |