Dependent static library depends on Qt ....
Posted: Fri Jan 15, 2010 2:23 pm
Hi...
I found a problem, could be a bug.
My project "son" is a QT based project, which relies on "father" (which is also a QT based project )
(Yes, as you might have guessed out, I'd love "son" inherit some .ui-built-classes of "father" .
Then, I built "father" into a static library, we may call it "libfather.a" .
When I tried to build "son", it could be a bug that the linked library sequence are like
Here comes the problem because "libfather.a" is a static library, which depends on "QtGui", "QtCore", and "pthread" as well.
So, there might be a library link sequence problem here.
Can you please ensure those "system libraries" are linked first, at the very very beginning of the library link sequence???
Say,
But, I'm not quite sure whether this could be a problem or not. I just guessed so.
The error messages I obtained are something like:
Finally, if I changed "father" form static library to an executable project, I can run "father" correctly, with Qt GUI displayed perfectly.
So, any suggestions?
Best Regards
JIA
I found a problem, could be a bug.
My project "son" is a QT based project, which relies on "father" (which is also a QT based project )
(Yes, as you might have guessed out, I'd love "son" inherit some .ui-built-classes of "father" .
Then, I built "father" into a static library, we may call it "libfather.a" .
When I tried to build "son", it could be a bug that the linked library sequence are like
Code: Select all
"-L/usr/lib -L../father/Debug -lfather -lQtGui -lQtCore -lpthread "
So, there might be a library link sequence problem here.
Can you please ensure those "system libraries" are linked first, at the very very beginning of the library link sequence???
Say,
Code: Select all
"-L/usr/lib -L../father/Debug -lQtGui -lQtCore -lpthread -lfather"
The error messages I obtained are something like:
Code: Select all
undefined reference to `....'
Finally, if I changed "father" form static library to an executable project, I can run "father" correctly, with Qt GUI displayed perfectly.
So, any suggestions?
Best Regards
JIA