Mail Archives: cygwin/2000/10/18/22:47:38
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 -