Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Wed, 18 Oct 2000 22:46:54 -0400 From: Christopher Faylor To: cygwin AT sources DOT redhat DOT com Subject: Re: gcc and Win32 API Message-ID: <20001018224654.A12747@cygnus.com> Reply-To: cygwin AT sources DOT redhat DOT com Mail-Followup-To: cygwin AT sources DOT redhat DOT com References: <80575AFA5F0DD31197CE00805F650D7602CDD1 AT wilber DOT adroit DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.6i In-Reply-To: ; 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 AT 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 AT sourceware DOT cygnus DOT com