After installing qwt-6.1.2.zip I see it at:
/usr/local/qwt-6.1.2/lib/libqwt.so
The Qt app I'm developing depends on in, so the .pro has the following:
INCLUDEPATH += "/usr/local/qwt-6.1.2/include"
LIBS += -L"/usr/local/qwt-6.1.2/lib"
CONFIG(debug, debug|release) {
LIBS += -lqwtd
} else {
LIBS += -lqwt
}
It compiles well but executing (outside QtCreator) gives:
"symbol lookup error: ...: undefined symbol"
Which is solved by doing:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/qwt-6.1.2/lib
export LD_LIBRARY_PATH
If I understand it correctly, LD_LIBRARY_PATH should only be set in case the .so files are in exotic (non-standard) locations. Question, /usr/local/qwt-6.1.2/lib
is standard (I guess not)?
When and where should LD_LIBRARY_PATH be set? I think one option is to do that at installation time, something like:
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/qwt-6.1.2/lib" >> .bashrc
echo "export LD_LIBRARY_PATH" >> .bashrc
One downside of this is that multiple installations will write that stuff multiple times to .bashrc.
My question is related to this and actually I ended up using the -rpath
idea, but I think the context here could be seen as more specific, related to Qt, so isn't duplicate. In fact, I ended up using this.