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

Re: linking confusion


"Jenny Gable (Skywind)" <jgable@imsa.edu> writes:
> I'm having trouble with linking (first program, using example code), and
> found in the docs,
> 
> "The regular setup allows you to use the option -mwindows on the command
> line to include a set of the basic libraries (and also make your program
> a GUI program instead of a console program), including user32, gdi32
> and, IIRC, comdlg32."
> 
> So says the documentation, but gcc and ld both complain that -mwindows
> isn't a valid option.  So what command line is this talking about?  
> 

There is some inconsistency in the handling of -mwindows by gcc. It allows
it *only* for the link step, and not for the compile step (I'm going to
submit a patch to make it accept in both cases). Here's an example:
   
 OK:

   % gcc -c foo.c
   % gcc -mwindows -o foo foo.o
 
 Not OK:

   % gcc -mwindows -o foo.c

ld doesn't understand -mwindows. It's just a shortcut for GCC that passes
the '--subsystem windows' option to ld as well as supplies some extra
libraries needed for usual GUI "-luser32 -lgdi32 -lcomdlg32".

Regards,
Mumit
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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