Re: [Interest] qmake, executable static libs...

2015-06-18 Thread Thiago Macieira
On Thursday 18 June 2015 09:24:38 Igor Mironchik wrote:
 Hi guys,
 
 I'm porting Qt 5 application to Linux and ran into a problem of linking.
 
 This application depends on two external static libs (let's say libs A
 and B). But this libs is in the tree of the project.
 
 And this project depends on two yet internal static libs (let's say libs
 C and D). Libs C and D depends on libs A and B.
 
 All static libs creates successfully.
 
 But executable can't link. I have added all 4 static libs ( A,B,C,D ) to
 the project of executable ( link rules, pretarget deps...)
 
 And ld says when linking executable that in static lib C there are
 undefined references to functions and methods from static lib A.
 
 What should I do in .pro files to solve this problem.

You need to list the libraries in the right order. The order of static 
libraries is relevant, unlike for dynamic libraries.

You must first list the library that requires a symbol, then the library that 
provides the symbol, so that the undefined reference can be resolved.

Or the other way around...
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qmake, executable static libs...

2015-06-18 Thread Igor Mironchik
Hi.

On 18.06.2015 09:48, Thiago Macieira wrote:
 On Thursday 18 June 2015 09:24:38 Igor Mironchik wrote:
 Hi guys,

 I'm porting Qt 5 application to Linux and ran into a problem of linking.

 This application depends on two external static libs (let's say libs A
 and B). But this libs is in the tree of the project.

 And this project depends on two yet internal static libs (let's say libs
 C and D). Libs C and D depends on libs A and B.

 All static libs creates successfully.

 But executable can't link. I have added all 4 static libs ( A,B,C,D ) to
 the project of executable ( link rules, pretarget deps...)

 And ld says when linking executable that in static lib C there are
 undefined references to functions and methods from static lib A.

 What should I do in .pro files to solve this problem.
 You need to list the libraries in the right order. The order of static
 libraries is relevant, unlike for dynamic libraries.

 You must first list the library that requires a symbol, then the library that
 provides the symbol, so that the undefined reference can be resolved.

 Or the other way around...

Didn't know about it... Thank you, reorder of libraries helped.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] qmake, executable static libs...

2015-06-18 Thread Igor Mironchik
Hi guys,

I'm porting Qt 5 application to Linux and ran into a problem of linking.

This application depends on two external static libs (let's say libs A 
and B). But this libs is in the tree of the project.

And this project depends on two yet internal static libs (let's say libs 
C and D). Libs C and D depends on libs A and B.

All static libs creates successfully.

But executable can't link. I have added all 4 static libs ( A,B,C,D ) to 
the project of executable ( link rules, pretarget deps...)

And ld says when linking executable that in static lib C there are 
undefined references to functions and methods from static lib A.

What should I do in .pro files to solve this problem.

P.S. On windows with MSVC linking is successful.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest