public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: khan@xraylith.wisc.edu (Mumit Khan)
To: help-gcc@gnu.org
Subject: Re: MINGW32
Date: Tue, 30 Nov 1999 23:28:00 -0000	[thread overview]
Message-ID: <81cacv$mjm$1@news.doit.wisc.edu> (raw)
Message-ID: <19991130232800.SARg2J9EieuTaNFWf130y9mwzocpxVSG0cfReP_XGck@z> (raw)
In-Reply-To: <3839a2d9@news.bezeqint.net>

In article < 3839a2d9@news.bezeqint.net >, Uri Yanover <uriyan@yahoo.com> wrote:
>Hello anybody!
>I am a beginning programmer for Windows. I heard of GNU ports for
>DOS/Windows. I chose MINGW32 , so I downloaded the binaries, the libraries,
>the tools etc. I installed it (unzipped and set up the environment). Then I
>compiled and linked a few examples (one from the SDK and one from Petzold)
>using the main libraries (user32, gdi32, kernel32, comdlg32 and  comctl32),
>like this.

What version are you running? The latest versions are at:

  http://www.xraylith.wisc.edu/~khan/software/gnu-win32/

No setup required, just run self-extracting executable to install, 
add the binary directory to PATH and go.

>SET DEFAULTLIB=c:\mingw32\lib

Not needed in the new releases (4 in the last 1-1/2 years or so).

>SET GUILIBS=-L%DEFAULTLIB% -luser32 -lgdi32 -lkernel32 -lcomdlg32 -lcomctl32

-luser32 and -lkernel32 are automatically linked in, so no need. `gcc -v'
when linking shows exactly what's being linked in, so that's a good 
diagnostic tool.

>gcc -c hellowin.c
>gcc -o hellowin.exe hellowin.o %GUILIBS%

Add -mwindows, which expands to the following, to avoid the DOS window: 
  -Wl,--subsystem,windows -lgdi32 -lcomdlg32

So, the following are equivalent:
  
  $ gcc -c hellowin.c
  $ gcc -o hellowin.exe hellowin.o -mwindows -lcomctl32

To see what's going on, add the -v option:

  $ gcc -v -o hellowin.exe hellowin.o -mwindows -lcomctl32

Mingw32 questions are probably best posted to the appropriate mailing
lists -

  - Cygwin -- http://sourceware.cygnus.com/lists.html ) -- Mingw and Cygwin
    share the same development tools, so the answers are the same.
  - Mingw32 -- http://www.eGroups.COM/lists/mingw32.html

Regards,
Mumit

  reply	other threads:[~1999-11-30 23:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-22 12:10 MINGW32 Uri Yanover
1999-11-22 13:07 ` Mumit Khan [this message]
1999-11-23 12:30   ` MINGW32 Uri Yanover
1999-11-30 23:28     ` MINGW32 Uri Yanover
1999-11-27 21:59   ` MINGW32 Bill Bartley
1999-11-28 11:45     ` MINGW32 Mumit Khan
1999-11-30 23:28       ` MINGW32 Mumit Khan
1999-11-30 23:28     ` MINGW32 Bill Bartley
1999-11-30 23:28   ` MINGW32 Mumit Khan
1999-11-30 23:28 ` MINGW32 Uri Yanover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='81cacv$mjm$1@news.doit.wisc.edu' \
    --to=khan@xraylith.wisc.edu \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).