Programming in Linux Fedora Core2


#1

while compiling with static library (okFrontPanel.a) in Linux Environment (FC2)
I met this linking error message below.
I don’t know why g++ cannot find sysbol infomations in the static library.
(I renamed okFrontPanel.a --> libokFrontPanel.a)

what should I do…? please help me… :confused:
Thanks for reading.

[karisuma@localhost 2_XEM_TEST] make g++ -o index index.o -lokFrontPanel -L. `wx-config --libs` ./libokFrontPanel.a(okCUsbFrontPanel.o)(.gnu.linkonce.t._ZNSt4listIP15okCEventHandlerSaIS1_EE9_M_insertESt14_List_iteratorIS1_ERKS1_+0x24): In function `std::list >::_M_insert(std::_List_iterator, okCEventHandler* const&)': : undefined reference to `std::_List_node_base::hook(std::_List_node_base*)' ./libokFrontPanel.a(okCUsbFrontPanel.o)(.gnu.linkonce.t._ZNSt4listIP17okEventTableEntrySaIS1_EE9_M_insertESt14_List_iteratorIS1_ERKS1_+0x24): In function `std::list >::_M_insert(std::_List_iterator, okEventTableEntry* const&)': : undefined reference to `std::_List_node_base::hook(std::_List_node_base*)' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x134): In function `okCUsbDevice::BulkTransferIn(unsigned char, unsigned char*, long&)': : undefined reference to `usb_bulk_read' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x1a8): In function `okCUsbDevice::BulkTransferOut(unsigned char, unsigned char*, long&)': : undefined reference to `usb_bulk_write' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x22b): In function `okCUsbDevice::VendorRequestIn(char, short, short, long, unsigned char*)': : undefined reference to `usb_control_msg' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x2a2): In function `okCUsbDevice::VendorRequest(char, short, short, long, void const*)': : undefined reference to `usb_control_msg' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x36b): In function `okCUsbDevice::GetSerialNumber()': : undefined reference to `usb_get_string_simple' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x535): In function `okCUsbDevice::~okCUsbDevice [not-in-charge]()': : undefined reference to `usb_release_interface' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x546): In function `okCUsbDevice::~okCUsbDevice [not-in-charge]()': : undefined reference to `usb_close' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x56b): In function `okCUsbDevice::~okCUsbDevice [in-charge]()': : undefined reference to `usb_release_interface' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x57c): In function `okCUsbDevice::~okCUsbDevice [in-charge]()': : undefined reference to `usb_close' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x58d): In function `okCUsbDevice::GetDeviceCount()': : undefined reference to `usb_init' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x592): In function `okCUsbDevice::GetDeviceCount()': : undefined reference to `usb_find_busses' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x597): In function `okCUsbDevice::GetDeviceCount()': : undefined reference to `usb_find_devices' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x59c): In function `okCUsbDevice::GetDeviceCount()': : undefined reference to `usb_get_busses' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x617): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_init' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x61c): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_find_busses' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x621): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_find_devices' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x63a): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_release_interface' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x64b): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_close' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x65d): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_get_busses' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x6c8): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_open' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x6f6): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_set_configuration' ./libokFrontPanel.a(okCUsbDevice_Linux.o)(.text+0x709): In function `okCUsbDevice::Open(unsigned char)': : undefined reference to `usb_claim_interface' collect2: ld returned 1 exit status make: *** [all] Error 1 [karisuma@localhost 2_XEM_TEST]


#2

You also need -lusb.

The Linux version of the FrontPanel API depends on ‘libusb’. Most distributions have libusb 0.1.8 installed by default. That should do.

Note, some distributions have a bug with libusb that will also manifest with the FrontPanel API. Namely, Fedora Core 3, FC4, and SuSE 9.2 all have problems with libusb.


#3

Thanks for your help.
some linking error messages concerning the libusb library has gone.
but still remain some messages about library 'okFrontPanel.a ’
what’s wrong…??

[karisuma@localhost 2_XEM_TEST] make g++ -o index index.o -lokFrontPanel -lusb -L. `wx-config --libs` ./libokFrontPanel.a(okCUsbFrontPanel.o)(.gnu.linkonce.t._ZNSt4listIP15okCEventHandlerSaIS1_EE9_M_insertESt14_List_iteratorIS1_ERKS1_+0x24): In function `std::list >::_M_insert(std::_List_iterator, okCEventHandler* const&)': :[COLOR=DarkOrange] undefined reference to `std::_List_node_base::hook(std::_List_node_base*)'[/COLOR] ./libokFrontPanel.a(okCUsbFrontPanel.o)(.gnu.linkonce.t._ZNSt4listIP17okEventTableEntrySaIS1_EE9_M_insertESt14_List_iteratorIS1_ERKS1_+0x24): In function `std::list >::_M_insert(std::_List_iterator, okEventTableEntry* const&)': :[COLOR=DarkOrange] undefined reference to `std::_List_node_base::hook(std::_List_node_base*)'[/COLOR] collect2: ld returned 1 exit status make: *** [all] Error 1 [karisuma@localhost 2_XEM_TEST]