Libqgif.so in a different folder [SOLVED]
How can I use a different directory for the plugin : libqgif.so ?
When executing, my binary works only if they's a directory named : imageformats/ containing libqgif.so
I want to put this library in a different directory so that I can have a cleaner architecture like
- bin ----> myBin
- lib ---->libqgif.so
Thanks in advance.
This depends on your OS.
On linux you can use LD_LIBRARY_PATH, or add -Wl,-rpath=path to the linker option for instance, I think this should work on Mac OS too. I am not aware of a similar way to do it on Windows...
Thanks for your answer.
I am using Linux.
Are you sure?
This will not work as the QtCore hard coded the path to the <QtInstall>/plugin/imageformats for the search.
You can use "qt.conf":http://qt-project.org/doc/qt-5/qt-conf.html for that but the imageformats folder is still needed. Qt searches for specific plugin types in specific folders, see "here":http://qt-project.org/doc/qt-5.0/qtcore/plugins-howto.html.
Hi SGaist, suppose I want to find my plugin libqgif.so in the path : /export/home/lib
what can I add in the qt.conf
Do you mean /export/home/lib/imageformats ?
Okay. I got you. I will test it. And come back.
thanks in advance.
Great! It is working indeed. The name imageformats is compulsory indeed.