How to include shared library?
Unsolved
General and Desktop
-
I have a console application that runs in Qt Creator. However when I try to run it in the terminal I get an error concerning a library:
error while loading shared libraries: libCbcSolver.so.0: cannot open shared object file: No such file or directory
The "pro" file has the lines to link to the library:
LIBS += -L/home/daniel/Documents/COINOR/Cbc-2.10/build/lib -lCbc -lCbcSolver INCLUDEPATH += /home/daniel/Documents/COINOR/Cbc-2.10/build/include/coin
Is there a way to include the shared library into the executable? So there is no need for:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/daniel/Documents/COINOR/Cbc-2.10/build/lib export LD_LIBRARY_PATH
-
@Guerrian said in How to include shared library?:
Is there a way to include the shared library into the executable?
Either build the lib as static libs or add the library code to your project.
But actually you should simply deploy your app with all needed libs properly: https://doc.qt.io/qt-5/linux-deployment.html