How do I use the Boost libraries in a qmake project?

前端 未结 2 1899
说谎
说谎 2021-01-31 06:21

Some days ago I compiled Boost ver. 1.53.0 for VS2012. It works fine, compiles fine. Now I want to use Boost with Qt Creator. In the .pro file I\'ve included

2条回答
  •  你的背包
    2021-01-31 06:56

    INCLUDEPATH += C:\boost\boost_1_53_0\  -lboost_filesystem
    LIBS += C:/boost/boost_1_53_0/stage/lib/
    

    Wrong.

    Read this.

    Solution:

    INCLUDEPATH += C:/boost/boost_1_53_0/
    LIBS += "-LC:/boost/boost_1_53_0/stage/lib/"
    

    Boost has complicated library names ("libboost_filesystem-vc90-mt-1_53.lib") and in case of msvc it links them automatically.) If you want to link additional lib, you do it like this:

    LIBS += "-LMyLibraryPath" -lmylib
    

    Where MyLibraryPath is library path, and mylib is library you want to link with.

    i'm the first with this error.

    The error most likely occurs because compiler tries to open directory as if it were a file or something like that.

提交回复
热议问题