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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -