QMake: accessing the library using relative paths

I have a Qt project using SQLite, so I have the following directory structure:

C:\Workspace\MyProject\MyProject.pro
C:\Workspace\MyProject\sqlite3\sqlite3.lib

Adding sqlite3.lib with absolute paths works great:

LIBS += -L"c:/Workspace/MyProject/sqlite3" -lsqlite3

But I cannot get it to work with relative paths. I am doing my best:

LIBS += -L"sqlite3" -lsqlite3

But this fails:

:-1: error: LNK1104: cannot open file 'sqlite3\sqlite3.lib'

I tried, but LIBS += -L"../sqlite3"or even LIBS += -L"../../sqlite3", but that didn't work either.

I am using MSVC 2008 for the compiler toolchain.

+4
source share
1 answer

, , , , $$PWD/ (PWD qmake *.pro).

:

LIBS += -L"$$PWD/sqlite3" -lsqlite3
+7

Source: https://habr.com/ru/post/1524714/


All Articles