Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Wed, 18 Oct 2000 22:46:54 -0400
From: Christopher Faylor <cgf@redhat.com>
To: cygwin@sources.redhat.com
Subject: Re: gcc and Win32 API
Message-ID: <20001018224654.A12747@cygnus.com>
Reply-To: cygwin@sources.redhat.com
Mail-Followup-To: cygwin@sources.redhat.com
References: <80575AFA5F0DD31197CE00805F650D7602CDD1@wilber.adroit.com> <Pine.OSF.4.21.0010190006001.26047-100000@garfield.cs.mun.ca>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.6i
In-Reply-To: <Pine.OSF.4.21.0010190006001.26047-100000@garfield.cs.mun.ca>; from nzanella@cs.mun.ca on Thu, Oct 19, 2000 at 12:10:45AM -0230

On Thu, Oct 19, 2000 at 12:10:45AM -0230, Neil Zanella wrote:
>
>Thanks. The suggested line works...
>
>This is funny though. If I type the exact same command as suggested but
>include the -lgdi32 just after the gcc instead of at the end of the line
>then the complier still returns the undefined reference to
>`GetStockObject@4' error. I thought that the order in which the flags were
>entered on the command line did not matter.

File: gcc.info,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GCC

Options for Linking
===================

   These options come into play when the compiler links object files
into an executable output file.  They are meaningless if the compiler is
not doing a link step.


`-lLIBRARY'
     Search the library named LIBRARY when linking.

     It makes a difference where in the command you write this option;
     the linker searches processes libraries and object files in the
     order they are specified.  Thus, `foo.o -lz bar.o' searches
     library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
     refers to functions in `z', those functions may not be loaded.

     The linker searches a standard list of directories for the library,
     which is actually a file named `libLIBRARY.a'.  The linker then
     uses this file as if it had been specified precisely by name.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

