user2744971
user2744971

Reputation: 123

How can I verify linked libraries?

I am having lots of trouble getting a specific set of drivers working, called libnifalcon.

I am pretty sure that the installation was successful, but when I try to compile the example programs I get the errors:

mars@marslab:~/Documents/libnifalcon-1.0/examples/findfalcons$ g++ findfalcons.cpp 
/tmp/cc8TtfGn.o: In function `runFalconTest()':
findfalcons.cpp:(.text+0x6b): undefined reference to `libnifalcon::FalconDevice::FalconDevice()'
findfalcons.cpp:(.text+0xdd): undefined reference to `libnifalcon::FalconDevice::getDeviceCount(unsigned int&)'
findfalcons.cpp:(.text+0x1bd): undefined reference to `libnifalcon::FalconDevice::open(unsigned int)'
findfalcons.cpp:(.text+0x224): undefined reference to `libnifalcon::FalconDevice::isFirmwareLoaded()'
findfalcons.cpp:(.text+0x2ac): undefined reference to `libnifalcon::FalconFirmware::loadFirmware(bool, unsigned int const&, unsigned char*)'
findfalcons.cpp:(.text+0x33b): undefined reference to `libnifalcon::FalconDevice::isFirmwareLoaded()'
findfalcons.cpp:(.text+0x3dd): undefined reference to `libnifalcon::FalconDevice::runIOLoop(unsigned int)'
findfalcons.cpp:(.text+0x504): undefined reference to `libnifalcon::FalconDevice::runIOLoop(unsigned int)'
findfalcons.cpp:(.text+0x512): undefined reference to `libnifalcon::FalconDevice::close()'
findfalcons.cpp:(.text+0x52b): undefined reference to `libnifalcon::FalconDevice::~FalconDevice()'
findfalcons.cpp:(.text+0x53f): undefined reference to `libnifalcon::FalconDevice::~FalconDevice()'
/tmp/cc8TtfGn.o: In function `void libnifalcon::FalconDevice::setFalconFirmware<libnifalcon::FalconFirmwareNovintSDK>()':
findfalcons.cpp:(.text._ZN11libnifalcon12FalconDevice17setFalconFirmwareINS_23FalconFirmwareNovintSDKEEEvv[void libnifalcon::FalconDevice::setFalconFirmware<libnifalcon::FalconFirmwareNovintSDK>()]+0x1d): undefined reference to `libnifalcon::FalconFirmwareNovintSDK::FalconFirmwareNovintSDK()'
collect2: ld returned 1 exit status

How can I verify the libraries are linked correctly? What can I do if they aren't?

Upvotes: 2

Views: 262

Answers (1)

Mike Makuch
Mike Makuch

Reputation: 1838

You're not linking with anything, i.e.

g++ file.cpp

does not link to any libraries other than the standard library. You need to link with other modules or libraries, probably libnifalcon

g++ findfalcons.cpp -lnifalcon

or... you probably will need to do something like

g++ -L/path/to/libnifalcon findfalcons.cpp -lnifalcon

where -I tells where to look for libraries.

Upvotes: 2

Related Questions