Can not compile executable with dynamic library
Posted: Thu Nov 22, 2018 1:19 am
OS: Linux Mint 18.3 Cinamon 64bit ver. 3.6.7
CodeLite ver 12.0.0 - It is NOT self compiled version
--version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609)
In workspace I have two projects :
1)Czujniki - which is executable gcc project with cmake
2)tinyxml - which is a dynamic library
After compiling tinyxml everthing is ok and in output directory I can find "libtinyxml.so".
However when I try compiling Czujniki I receive linker error
In project Czujniki I have following settings :
Project Settings->Global Setings -> library path = ".;/output"
Project Settings->Global Setings -> Libraries = "libtinyxml.so"
How make linking working ?
CodeLite ver 12.0.0 - It is NOT self compiled version
--version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609)
In workspace I have two projects :
1)Czujniki - which is executable gcc project with cmake
2)tinyxml - which is a dynamic library
After compiling tinyxml everthing is ok and in output directory I can find "libtinyxml.so".
However when I try compiling Czujniki I receive linker error
Code: Select all
/bin/sh -c 'cd /home/marek/Dokumenty/Czujniki/cmake-build-Debug/Czujniki && /usr/bin/make -e '
[ 33%] Linking CXX executable /home/marek/Dokumenty/Czujniki/cmake-build-Debug/output/Czujniki
/usr/bin/ld: cannot find -ltinyxml
collect2: error: ld returned 1 exit status
CMakeFiles/Czujniki.dir/build.make:120: recipe for target '/home/marek/Dokumenty/Czujniki/cmake-build-Debug/output/Czujniki' failed
make[2]: *** [/home/marek/Dokumenty/Czujniki/cmake-build-Debug/output/Czujniki] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Czujniki.dir/all' failed
make[1]: *** [CMakeFiles/Czujniki.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
====1 errors, 0 warnings====
Project Settings->Global Setings -> library path = ".;/output"
Project Settings->Global Setings -> Libraries = "libtinyxml.so"
How make linking working ?