[Qt-interest] How to use a shared library with QMake/QtCreator under Linux?

Abdelrazak Younes younes.abdel at gmail.com
Wed Mar 11 15:33:07 CET 2009


Abdelrazak Younes wrote:
> Hello,
>
> I created a shared library and an application with qtcreator. The 
> application correctly build and link with my library. So far so good. 
> Problem is that, unless I run ldconfig on the location of the library, 
> the application won't start.
>
> Under Windows I simply have to copy the dll in the same directory as 
> in the executable, or just put it in the path.
>
> Is there a way to put some post-compilation hook in the qmake project 
> of the library so that ldconfig is run automatically?

Hum sorry to answer my own question but one trick would be to set the 
LD_LIBRARY_PATH before launching the executable. Unfortunately, I can't 
find where the executable name is set within QtCreator; anybody knows?

My goal would be to let QtCreator launch 
LD_LIBRARY_PATH=../my_lib_path/:$LD_LIBRARY_PATH ./my_app

Abdel.




More information about the Qt-interest-old mailing list