This is the mail archive of the cygwin@cygwin.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]

linking with Win32 API


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


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