This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: problem with egcs-2.91.66 on Win32
- To: help-gcc at gnu dot org
- Subject: Re: problem with egcs-2.91.66 on Win32
- From: khan at xraylith dot wisc dot edu (Mumit Khan)
- Date: 12 Nov 1999 04:06:02 GMT
- Newsgroups: gnu.gcc.help
- Organization: Center for X-ray Lithography, UW-Madison
- References: <cxIW3.26$as2.586@news.iol.ie>
- Xref: wodc7nx0 gnu.gcc.help:1793
In article <cxIW3.26$as2.586@news.iol.ie>,
Gothmog <gothmog2000@hotmail.com> wrote:
>I'm having a problem: I cannot call basic Win32 functions using egcs
>compiler (mingw32):
>
>#include <windows.h>
>
>int main()
>{
> MessageBoxA(0, "Testing Windows!", "Test", MB_OK | MB_ICONINFORMATION);
> return 0;
>}
>
>This comes up with an error:
>c:\tmp\ccHGdggb.o(.text+0x2f):test.cc: undefined reference to
>`MessageBoxA@16'
Older versions of gcc on windows32 (before egcs-1.1.2) didn't link
with libuser32.a by default, and that's what you're seeing.
Solution:
1. upgrade to gcc-2.95.2
2. Link with -luser32 explicitly.
$ gcc -o foo foo.c -luser32
There have two binary releases (gcc-2.95 and gcc-2.95.2), and I do
recommend that you upgrade.
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/
Regards,
Mumit