Quentin
Quentin

Reputation: 734

ld can't find an available library

I have a problem when linking my application, ld could not find an available library :

/usr/bin/ld : could not find -lVtsUtils_0.1.5d
/usr/bin/ld : could not find -lVtsCore_0.1.5d
/usr/bin/ld : could not find -llibmysql

The compile line is (found through make VERBOSE=1) :

/usr/bin/c++ -g CMakeFiles/Dental.dir/main.cpp.o CMakeFiles/Dental.dir/qrc_myproject.cpp.o CMakeFiles/Dental.dir/Dental_automoc.cpp.o -o ../../../bin/debug/Dentald -L/home/naccyde/Projets/myproject/lib/linux -rdynamic /usr/lib64/libQt5Widgets.so.5.6.2 -lVtsUtils_0.1.5d -lVtsCore_0.1.5d -llibmysql /usr/lib64/libQt5Gui.so.5.6.2 /usr/lib64/libQt5Core.so.5.6.2 -Wl,-rpath,/home/naccyde/Projets/myproject/lib/linux

But ls -l /home/naccyde/Projets/myproject/lib/linux show :

-rwxrwxrwx. 1 naccyde naccyde  2067984  2 mars  17:34 VtsCore_0.1.5d.so
-rwxrwxrwx. 1 naccyde naccyde 10984568  2 mars  17:34 VtsNavigation_0.1.5d.so
-rwxrwxrwx. 1 naccyde naccyde  4760776  2 mars  17:34 VtsUtils_0.1.5d.so

I can't understand why it does not work.

Upvotes: 0

Views: 139

Answers (1)

Some programmer dude
Some programmer dude

Reputation: 409136

Libraries on Linux (or all POSIX systems) need to be prefixed with lib. So a dynamic library called VtsCore_0.1.5d should have the filename libVtsCore_0.1.5d.so.

Rename your libraries appropriately. Or pass the full path to the actual library files (e.g. /home/naccyde/Projets/myproject/lib/linux/VtsCore_0.1.5d.so) to the linker.

Upvotes: 4

Related Questions