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]
Other format: [Raw text]

Advance WinMain@16


Folks

To forestall calls of RTFF (Read the Fabulous FAQ) and RTFM (Read the
FAQ,Man) I should inform you that I have the Cygwin FAQ open to the
pertinent question on my browser window even as I type this.

I am attempting to get AutoGen to compile under Cygwin on a W2K machine.
This package comes with a support library as well as the main executable.
The support library initially failed to link due to the missing WinMain@16,
so I read the FAQ. Following its suggestion, I added a dummy main to one of
the source files of the support library. After this it built fine.

But, when I attempted to build main application which uses the support
library, I got the multiple definitions of main complaint and the link
failed. I did check and the real main is in the linker command line before
the library reference. 

I suspect that what really needed to be done with the support library was to
create an additional source file with the dummy main, so it would be its own
.o within the archive. Thus the linker would not try to grab it when
building the main app, and no multiple definition complaint would occur.

One note is that the support library is directly referenced (the .a
explicitly named in the linker line) vs. using the -l option. My
understanding of linkers is that this should not affect the linking, but I
thought I should mention it.

The purpose of this note is two-fold. The first is to see if some more
experience Cygwin library builders could confirm my conjecture, before I
munge with the makefiles to test this and pass it on to the package
maintainer. The second is to suggest that if the first is true, the FAQ
might want to be amended to make more clear what needs to be done in the
library case.

Thank you for your time.
Dale Pennington

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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