delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/12/17/18:32:34

From: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters)
Subject: Re: first time compiling windows app with gcc
17 Dec 1997 18:32:34 -0800 :
Message-ID: <01bd0b56$149453c0$fa173185.cygnus.gnu-win32@gbird0.fu.is.saga-u.ac.jp>
Reply-To: "Colin Peters" <colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp>
Mime-Version: 1.0
To: "=?iso-8859-1?Q?Kurt_H=E4usler?=" <turtill AT ihug DOT co DOT nz>
Cc: "GNU-Win32" <gnu-win32 AT cygnus DOT com>

Given that your hello world program is *not* the example from Petzold's
Programming Windows 95 (which uses the multi-media API to play a sound
file) then it will probably compile if you do:

gcc -o hello.exe hello.c -mwindows

or

gcc -o hello.exe hello.c -luser32 -lgdi32 -Wl,--subsystem,windows

Which is roughly equivalent. Under Mingw32 0.1.4 you have to use -windows
instead of -mwindows (that should change in the next version BTW) for the
first type.

For multiple module applications use the -mwindows option at the linking
step (it's not necessary when just compiling).

Colin.

PS. If it *is* the example from Petzold then you need to add -lwinmm to
either of the above command lines, and you need the extra mmsystem.h file
that isn't currently included in the Win32 API headers from Cygnus (which
I can give you if necessary).

PPS. You might want to look at my (incomplete) tutorial on Win32
programming with GCC. Add gcc-tutor-contents.html to the URL in my
signature (either one).

-- Colin Peters -- colin at fu.is.saga-u.ac.jp
-- Saga University Dept. of Information Science
-- http://www.fu.is.saga-u.ac.jp/~colin
-- http://www.geocities.com/Tokyo/Towers/6162

-----Original Message-----
From: Kurt Hdusler <turtill AT ihug DOT co DOT nz>
To: gnu-win32 AT cygnus DOT com <gnu-win32 AT cygnus DOT com>
Date: Wednesday, December 17, 1997 5:25 PM
Subject: first time compiling windows app with gcc


>hello, this question has already been asked by
carvalho AT penelope DOT dss DOT inpe DOT br
>but it wasnt answered.
>
>how can I compile programs when i get error messages like undefined
>reference etc.  this is just a program using the windows api to pop up
one
>window and saw hello world.
>
>I have compiled it before under two other compilers and one of them I had
to
>use a option like    -lwin32  or something.  What is the equivalent
option
>with this compiler?
>
>gcc hello.c is all I have been using.
>
>Please answer, I would be very greatful.
>
>Thanks from Kurt
>
>
>-
>For help on using this list (especially unsubscribing), send a message to
>"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019