Davita
Davita

Reputation: 9124

qmake build from command prompt

I need to have a cmd build script to address x86 x64 compilation issue associated with the IDE (i mean switching qt versions & rebuilding). The problem is that, in my .pro file, I add dependency on external library in this way:

LIBS += ../Libs/SomeExternal.lib

Now when I build this project from QtCreator, everything compiles and builds fine, but when I try to build using command prompt + qmake I get the following linker error:

LINK : fatal error LNK1104: cannot open file '../Libs/SomeExternal.lib'

I understand that this issue is related to paths, but I don't know how to let LINKER.exe see the location where my project is located. Just like QtCreator does.

I try to build using the following way:

Thanks

Upvotes: 0

Views: 1726

Answers (1)

Dave Mateer
Dave Mateer

Reputation: 17946

Use:

LIBS += -L$${PWD}/../Libs -lSomeExternal

From the documentation:

The PWD variable specifies the full path leading to the directory containing the current file being parsed.

Upvotes: 1

Related Questions