Subject: Re: first time compiling windows app with gcc
From: [email-masked] (Colin Peters)

17 Dec 1997 18:32:34 -0800
Message-ID: <[email-masked]>
Reply-To: "Colin Peters" <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
To: "=?iso-8859-1?Q?Kurt_H=E4usler?=" <[email-masked]>
Cc: "GNU-Win32" <[email-masked]>

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 <[email-masked]>
To: [email-masked] <[email-masked]>
Date: Wednesday, December 17, 1997 5:25 PM
Subject: first time compiling windows app with gcc

>hello, this question has already been asked by
[email-masked]
>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
>"[email-masked]" with one line of text: "help".
>

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".