Unsolved Modularized QT application - my program can't find .so files
-
I'm writing modularized application using QtCreator and QT 5.10. The program is being compiled using CLANG toolkit on an instance of GhostBSD (FreeBSD derivative).
My program consists of serveral .so modules (let's say file1.so and file2.so) linked using -L option and the main binary.
The problem I have is I can't start the main binary, because the program loader can't find file1.so and file2.so even if they are in the same directory as the main program.
So the question is, how to install an output files (.so) into /usr/lib directory?
My very first idea was to call make install as an extra build step, but it needs root.
How to do that correctly? -
@BSDUser Take a look at http://doc.qt.io/qt-5/linux-deployment.html
-
@BSDUser said in Modularized QT application - my program can't find .so files:
The problem I have is I can't start the main binary, because the program loader can't find file1.so and file2.so even if they are in the same directory as the main program.
On Windows it would work that way, but Unix explicitely forbidds loading libraries from the working directory - for security resaon. You can however, force the linker to load them anyway, e.g. by modifying LD_LIBRARY_PATH.
So the question is, how to install an output files (.so) into /usr/lib directory?
My very first idea was to call make install as an extra build step, but it needs root.Correct, but for testing that's not needed. Creator automatically extends LD_LIBRAY_PATH if the linker options are correctly set. So can you please show your projects
.pro
file?Regards