link boost libs to qt with msvc

913 views Asked by At

I have installed qt-opensource-windows-x86-msvc2013_64_opengl-5.4.0.exe and compiled boost_1_58_0.zip with this command: b2 toolset=msvc --build-type=complete stage. It works fine with Visual Studio, but when I try use it with Qt I get this error:

:-1: error: LNK1104: cannot open file 'libboost_filesystem-vc120-mt-gd-1_58.lib'

Here is my .pro file:

TEMPLATE = app

QT += qml quick widgets

SOURCES += main.cpp \ testclass.cpp

RESOURCES += qml.qrc

INCLUDEPATH += C:\boost

LIBS += "-LC:\boost\stage\lib\libboost_filesystem-vc120-mt-gd-1_58.lib"

#Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH =

# Default rules for deployment. include(deployment.pri)

HEADERS += \ testclass.h

1

There are 1 answers

3
marom On BEST ANSWER

In the LIBS variable use just "-L" for correct library path (-L). You made a mix, specifying a file (lowercase l) while libs directory is missing.

You do not need to specify the library, boost has pragmas for that.