windows - QMake: Referencing a library using relative paths -


i have qt project using sqlite, have following directory structure:

c:\workspace\myproject\myproject.pro c:\workspace\myproject\sqlite3\sqlite3.lib 

adding sqlite3.lib absolute paths works fine:

libs += -l"c:/workspace/myproject/sqlite3" -lsqlite3 

but can't make work relative paths. try with:

libs += -l"sqlite3" -lsqlite3 

but fails with:

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

i tried libs += -l"../sqlite3" or libs += -l"../../sqlite3", didn't work either.

i'm using msvc 2008 compiler toolchain.

since it's possible build different directory project directory, relative path pointing project directory should prefixed $$pwd/ (pwd qmake variable contains absolute path directory processed *.pro file).

your line like:

libs += -l"$$pwd/sqlite3" -lsqlite3 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -