Using a static library in Qt Creator

Viewed 101239

I'm having a hell of a time finding documentation which clearly explains how to use a static library in Qt Creator.

I've created and compiled my static library using Qt Creator (New=>Projects\C++ Library=>Set type to "Statically Linked Library"). It compiles and spits out a ".a file".

The problem I encounter is when I try to use the library. I have another project that would like to use it (#include files in the library, etc) but I don't know the proper way to link with the library or include files from the library.

5 Answers

Is it

LIBS += -L"/some path" -l"somename.a"

or

LIBS += -L/somepath -lsomename.a

or

LIBS += -L/somepath -lsomename"

This should be as easy as it gets but for some reason it is EXTREMELY hard to pull up a search result for because there are so many hits of forums of people asking for help and I've followed every tip I can get but no help...

Related