Re: [GnuWin32-Users] linking error: unresolved symbols drand48_r, stdin and stdout
Provides native Win32 open source ports and utilities
Brought to you by:
gnuwin32
From: Keith M. <kei...@to...> - 2010-06-10 08:23:01
|
> gcc -lgw32c -lole32 -lm -o bin/mmc built/posix_randr.obj > built/simpmesh.obj > uilt/tettracing.obj built/mcx_utils.obj built/tictoc.obj built/tetray.obj " > > I am certain that gcc/ld had found the libgw32c.a that I placed > under c:\MinGW\lib, but somehow, it does not link :( It *does* link, and entirely predictably, includes *nothing* from the libraries in the linked image, because you told the linker to process all your libraries *before* it had read the objects to build its requirements list. This question has been answered about a squillion times on the MinGW mailing list; the order in which you specifed your link command args is *wrong*. The order matters[*], and -l... library specs *must* come *after* the object files requiring them, (and also in the correct order so that library interdependencies may be resolved). [*] FTR,, this command order is just as wrong for compiling on Linux. Also, .obj looks wrong for GCC; while the format may be correct, .o is the more normal object file extension. -- Regards, Keith. |