enam
enam

Reputation: 23

include external libraries (from a subdirectory of the source-code-folder) in qt

I am a bit confused by the way qt handles libraries. My plan was to put the external libraries I need into the source directory, so that a do not have to install them into the system. As this doesn't seem to work (see below) I was wondering, if this is generally a bad idea or if there is some trick to it??

So I compiled the libraries and put them into /mysubdir. In the .pro-file I added

LIBS+= -L"mysubdir" -l"mylib"

I got the compiler error [projectname] Error 2 and don't know what it means.

Upvotes: 1

Views: 363

Answers (1)

ayoy
ayoy

Reputation: 3835

The argument passed to -L must be an absolute path. Please give it a try with a full path, or at least -L./wcslibc. Though I'm not sure whether ./ will be recognized correctly. You can get the current path in qmake like this:

LIBS += -L$${PWD}/wcslibc -lwcs

Upvotes: 1

Related Questions