You know, that sounds vaguely familiar. :)
I think I spent a while, ago, finding the same thing.
My guess is that the linker looks at libraries, in sequence, to see if anything mentioned previously needs that library.
So, for example:
gcc -o test.exe a.o -lmath b.o
Works if a.c needs the math library. However, not if b.c needs it, because the math references in b.c were not noticed at the time it processed -lmath.
Just a guess, but it seems to be supported by the evidence.
Actually, this is supported by the manual entry for gcc, as follows:
Quote:
It makes a difference where in the command you write this option; the linker searches and 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.
As for what you said:
Quote:
Aparently Cygwin ain't to brite..
Working as documented. ;) |