linking .so file
-
When I'm trying to link my so objects from Qt inner terminal or External gnome terminal from my CPP app it does not work, has no effect
if I set if from gnome-terminal it works nicely
I made simple build function but it only works if I loop it and copy then paste manually to gnome-terminal
if there any way to fix it?
j@j:~/QUI-Debug$ cd /home/j/QUI-Debug && export LD_LIBRARY_PATH=/home/j/QPL-Debug/debug/debug:/home/j/SPL-Debug/debug/debug:/home/j/SML-Debug/debug/debug:$LD_LIBRARY_PATH
j@j:~/QUI-Debug$ ldd QUI
linux-vdso.so.1 (0x00007ffedabd8000)
libSpl.so.1 => /home/j/SPL-Debug/debug/debug/libSpl.so.1 (0x00007fe78f188000)
libSml.so.1 => /home/j/SML-Debug/debug/debug/libSml.so.1 (0x00007fe78efd7000)chunk below did not help either
const char* paths[] = {
"/home/j/SPL-Debug/debug/debug",
"/home/j/SML-Debug/debug/debug"
};std::string ld_library_path; for (const char* path : paths) { if (!ld_library_path.empty()) ld_library_path += ":"; ld_library_path += path; } cout << "ld_library_path:" << ld_library_path <<endl; setenv("LD_LIBRARY_PATH", ld_library_path.c_str(), 1);
-
@JacobNovitsky below seem to solve this task
#!/bin/bash
Set the directories containing the shared object files
SPL_DIR="/home/j/SPL-Debug/debug/debug"
SML_DIR="/home/j/SML-Debug/debug/debug"
QPL_DIR="/home/j/QPL-Debug/debug/debug"Concatenate the directories with the current LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$SPL_DIR:$SML_DIR:$QPL_DIR:$LD_LIBRARY_PATH"
Print the current LD_LIBRARY_PATH for verification
echo "LD_LIBRARY_PATH is set to: $LD_LIBRARY_PATH"
Use ldd to show the shared libraries used by the QUI application
ldd /home/j/QUI-Debug/QUI