GCC linking order

Yann Le Doaré yledoare@linuxconsole.org
Sat Jan 15 12:40:00 GMT 2005


Hi evrybody !

I tried to compile the "cxacru" DSL driver for linux, but when linking 
tools i had those errors :

gcc -O2 -Wstrict-prototypes -fomit-frame-pointer -pipe -march=i686 -Wall 
-DLINUX -I../include -I/usr/linuxconsole/core/include -lusb -lpthread 
-L/usr/linuxconsole/core/lib cxload.c -o cxload
/tmp/cc31iLZF.o(.text+0x17a): In function `transfer_ctrl_msg':
: référence indéfinie vers « usb_control_msg »
/tmp/cc31iLZF.o(.text+0x185): In function `transfer_ctrl_msg':
: référence indéfinie vers « usb_strerror »
/tmp/cc31iLZF.o(.text+0x220): In function `transfer_ctrl_msg':
: référence indéfinie vers « usb_clear_halt »
/tmp/cc31iLZF.o(.text+0x234): In function `transfer_ctrl_msg':
: référence indéfinie vers « usb_clear_halt »
/tmp/cc31iLZF.o(.text+0x27c): In function `read_bulk':
: référence indéfinie vers « usb_bulk_read »

.....

but when I move "cxload.c -o cxload" from the end to the beginning of 
command, all is OK

 gcc  cxload.c -o cxload -O2 -Wstrict-prototypes -fomit-frame-pointer 
-pipe -march=i686 -Wall -DLINUX -I../include 
-I/usr/linuxconsole/core/include -lusb -lpthread 
-L/usr/linuxconsole/core/lib                  


Do you think it is a GCC bug ?

Thanks

Yann Le Doaré.



More information about the Gcc-help mailing list