PDA

View Full Version : how to add a static lib to my project



TheRonin
15th November 2007, 16:39
I'm not sure how to do this correctly...

I've written a set of libs and compiled them with the Makefile produced from a .pro-file with the following settings:



TEMPLATE = lib
CONFIG += qt staticlib
...
...


I've then written a program that wishes to make use of the static libs. That .pro-file looks something like this:



TEMPLATE = app
CONFIG += debug warn_on console
DEPENDPATH += .
INCLUDEPATH += . $(MYLIB)/headers

SOURCES += main.cpp
HEADERS += testclass.h

LIBS += -L$(MYLIB)/bin -lmylib


Compilation of the test program works fine, but i get symbol referencing errors in the linking process. Have i missed some painfully obvious step here??

thanks in advance!

TheRonin
15th November 2007, 17:51
Upon closer inspection, the referencing errors that were being produced all referred to network and xml classes. I had added QT += network xml to the .pro-file of my lib, but since the lib's compilation doesn't actually link anything, i'm guessing i have to add that line to my test program's .pro-file instead.