- From: Charles-Edouard Ruault <ce_at_idtect.com>
- Date: Mon, 28 Apr 2003 17:12:30 +0200
Hi All, up to now i had been compiling comedi libs with gcc 2.95.4 and ld 2.12.90.0.1. Now i'm trying to use gcc 3.2.2/ld 2.13.90.0.18 and i'm getting some compilations errors ( not in the library itself but in the apps/demos linked with the library ). ------------- gcc -o comedi_calibrate comedi_calibrate.o ni.o cb.o cb64.o other.o save_cal.o -L../lib/ -lcomedi -lm comedi_calibrate.o(.text+0x1cb): In function `main': : undefined reference to `comedi_open' comedi_calibrate.o(.text+0x20d): In function `main': : undefined reference to `comedi_find_subdevice_by_type' comedi_calibrate.o(.text+0x226): In function `main': : undefined reference to `comedi_find_subdevice_by_type' etc.... ---------------------- So mainly it appears that all the functions exported by the comedi library are not found at link time. After spending some trying to figure out what was happening i found out the following : The functions exported using the EXPORT_SYMBOLmacro are present in the library file but only with the version number appended, not with the default name ( without the version number ), which causes the link problem reported above. For example here are some lines captured from , nm libcomedi.so.0.7.19-cvs compiled with the new gcc/ld versions 00002f30 T comedi_find_range_at_v0.7.18 00004ae0 T comedi_find_subdevice_by_type_at_v0.7.18 00002e60 T comedi_from_phys_at_v0.7.18 while the same command on the library compiled with the old gcc/ld versions will give: 00002b4c T comedi_find_range 00002b4c T comedi_find_range_at_v0.7.18 000044f4 T comedi_find_subdevice_by_type 000044f4 T comedi_find_subdevice_by_type_at_v0.7.18 I checked in the .o files and at this stage, both symbols ( with and without version ) are present so it appears that ld is suppressing the symbol without the version at link time. After looking at the ld manual, i could not figure out how to prevent this from happening :-( Has someone seen this already ? is there a known solution ? Thanks for your help/advice. Regards -- Charles-Edouard Ruault Idtect SA http://www.idtect.com +33-1-42-81-81-84
Received on 2003-04-28Z14:12:30