www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/10/18/22:47:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <cgf AT redhat DOT com>
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> <Pine DOT OSF DOT 4 DOT 21 DOT 0010190006001 DOT 26047-100000 AT garfield DOT cs DOT mun DOT ca>
Mime-Version: 1.0
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 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

- Raw text -


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