[Qt-interest] Static linking

Srdjan Todorovic todorovic.s at googlemail.com
Thu Jun 25 10:08:08 CEST 2009


Hi,

On 25/06/2009, Sujan Dasmahapatra <sdh at lmglasfiber.com> wrote:
> Dear Friends
>
> I am trying to make static linking for my application....But the
> executable is still dependent on qwt......I am specifying the  qwt lib
> in the *.pro file...And building  in release mode bbut when I am doing
> ldd ./application I can see it's still dependent of qwt and qwt.so file
> not found it's showing...What I am doing wrong please someone tell me.

Do you not have any UNIX/Linux/Qt books at your company?

You have probably compiled Qwt as a dynamic library.
Your application is linking with this dynamic library.
You need to have the dynamic library somewhere in your LD_LIBRARY_PATH
or in one of the system paths specified in /etc/ld.so.conf

Either distribute your dynamic Qwt library with your application, or
compile Qwt as a static library.

To do that you need to configure Qwt to be a static library. There
will be some sonfiguration option there for you to do it. It probably
involves editing the .pro file from Qwt and setting some CONFIG option
to contain the word 'static'.

Srdjan



More information about the Qt-interest-old mailing list