Hi,
I usually develop in Windows, so when trying to compile in Linux I feel like a total newbie.
I have a link problem in a project, so to simplify my problem to the maximum, I created a console project with just a main.cpp
which besides the user boilerplate code contains an include to ftrScanApi.h (a finger scanner's api header file)
and a single call to the scanner initialisation routine ftrScanOpenDevice(); The file main.cpp links
The problem is that there is a linker problem.
The project file contains
and the shared object library supplied is libScanAPI.soLIBS += -L/the/absolute/path/to/the/library -lScanAPI.so
ls reports it's a file that takes 180K, so it does not seem to be a link to another file.
and despite the simplicity of all of this I have the message
Now the file is obviously there, so what could go wrong?cannot find -lScanAPI.so
collect2: error: ld returned 1 exit status
Hi,
I usually develop in Windows, so when trying to compile in Linux I feel like a total newbie.
I have a link problem in a project, so to simplify my problem to the maximum, I created a console project with just a main.cpp
which besides the user boilerplate code contains an include to ftrScanApi.h (a finger scanner's api header file)
and a single call to the scanner initialisation routine ftrScanOpenDevice(); The file main.cpp links
The problem is that there is a linker problem.
The project file contains
and the shared object library supplied is libScanAPI.soLIBS += -L/the/absolute/path/to/the/library -lScanAPI.so
ls reports it's a file that takes 180K, so it does not seem to be a link to another file.
and despite the simplicity of all of this I have the message
Now the file is obviously there, so what could go wrong?cannot find -lScanAPI.so
collect2: error: ld returned 1 exit status
Added after 1 38 minutes:
If I type
then the linker problem goes away.LIBS += /the/absolute/path/to/the/library/libScanAPI.so
If I want a relative path, then I must take into account that the linker is being called inside a directory that may or may not be inside the sources, and I need to account for that...
Bookmarks