Libraries not working

John Garrison jeg@visi.net
Mon Jul 5 13:21:00 GMT 1999


I am sorry about responding to your help via personal email, the other
lists I have been on sent the message to the list when you reply. Maybe
you emailed to me instead of the list and I didn't bother to look,
sorry. Anyhow here is my reply to those in the list who might be able to

help.  By the way I am using a Linux version of the compiler, but it is
a cross-compiler so It outputs Windows executables.

> > /tmp/cciFT7S1.o(.text+0x103):show.c: undefined reference to
> > `IMG_Load_RW'
> >
/usr/win32/bin/../lib/gcc-lib/i586-mingw32/egcs-2.91.57/../../../../i586-mingw32/lib/libmingw32.a(main.o)(.text+0x7b):

> > undefined reference to `WinMain@16'
> > collect2: ld returned 1 exit status
> >
> > IMG_Load_RW is clearly defined in IMG.h which is included in the
show.c
> > source code.
>
> I guess that it is only declared, not defined
>

IMG_Load_RW is a function, it can't help but be defined. Well, I guess
it is possible to not define a function, but this is
is defined. Besides it compiles fine for Linux.

>
> > Also I have a main function and the FAQ says that if you
> > get the undefined reference to `WinMain@16' to include a blank main
> > statement, well, I am not building a library I already HAVE a main
> > statement.
>
> One solution: link with WinMain.o
> The other was explained by Mumit Khan in a posting May 13
>

WinMain.o?  Is that part of the distribution or do I have to create an
empty WinMain()  source file? By the way, does anybody know why Windows
decided to completely screw up portabilty with this WinMain function in
the first place? What is wrong with the main() statement we have been
using since like 1972 when the language was invented?


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



More information about the Cygwin mailing list