linking with Win32 API

Jim Baumbach jsb@fred.fcny.org
Thu May 17 14:37:00 GMT 2001


I'm trying to link to MessageBox which is in User32, or so says
http://msdn.microsoft.com/library/psdk/winui/dlgboxes_76bc.htm
But though it appears to find the library, it gives me an undefined
reference:
$ gcc -otest3 c:/temp/test3.c -luser32
/cygdrive/c/temp/cck6598G.o(.text+0x2e):test3.c: undefined reference to
`MessageBox'
collect2: ld returned 1 exit status
Message 1/584 From cygwin-digest-return-@sources.redhat.com Page 6
The FAQ also suggested -mwindows which got me:
$ gcc -mwindows -otest3 test3.c
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/../../../../i686-pc-cygwin/bin/ld:
warn
ing: cannot find entry symbol _WinMainCRTStartup; defaulting to 00401000
/cygdrive/c/temp/ccobP98G.o(.text+0x2e):test3.c: undefined reference to
`MessageBox'
collect2: ld returned 1 exit status
What am I doing wrong?
 -jim
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /