Libraries not working

Mumit Khan khan@xraylith.wisc.EDU
Sat Jul 31 18:34:00 GMT 1999


On Mon, 5 Jul 1999, John Garrison wrote:

> 
> 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.

This is your second post, but still no details. Without any details on 
what you're doing, how you're linking, what options you're passing to GCC 
and the linker, what files are being linked in, what language (C, C++), 
how are we supposed to know what's wrong???

> >
> > > 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
> >

This is incorrect. There is no WinMain.o.

> 
> 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?

WinMain() becomes the "entry" for GUI executables in Windows. As for how
the language has been changed under you on Windows, feel free to ask 
Microsoft ;-) Of course, I hope folks have switched from the language 
from 1972 to a much newer ANSI C, and soon to be C9x!

Regards,
Mumit



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



More information about the Cygwin mailing list