Good day. I have been sitting for a long time already, I’m fighting such a problem: I assembled the MongoDB and BSON drivers from under the compiler from the fifteenth visuals, and even made them build under qt. That's just for their work needed boost. At first I tried to just show him where the heders are. Did not help. I compiled the same compiler, tried to connect the lib from the system folder, as recommended in the next topic. Did not help. I tried to connect everything at once from "... / stage / lib". Did not help. Ideas run out. .Pro file:

QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = mngProj TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui #LIBS += -L$$PWD/../../../local/boost_1_59_0/stage/lib #LIBS += -L$$PWD/../../../local/boost_1_59_0/bin.v2/libs win32:CONFIG(release, debug|release): LIBS += -L$$PWD/mng_driver/lib/ -llibbsoncxx else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/mng_driver/lib/ -llibbsoncxxd INCLUDEPATH += $$PWD/mng_driver/include/bsoncxx/v_noabi DEPENDPATH += $$PWD/mng_driver/include/bsoncxx/v_noabi INCLUDEPATH += $$PWD/mng_driver/include/mongocxx/v_noabi DEPENDPATH += $$PWD/mng_driver/include/mongocxx/v_noabi INCLUDEPATH += $$PWD/mng_driver/include/libbson-1.0 DEPENDPATH += $$PWD/mng_driver/include/libbson-1.0 INCLUDEPATH += $$PWD/mng_driver/include/libmongoc-1.0 DEPENDPATH += $$PWD/mng_driver/include/libmongoc-1.0 win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../local/boost_1_59_0/bin.v2/libs/system/build/msvc-14.0/debug/link-static/threading-multi/ -llibboost_system-vc140-mt-gd-1_59 else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../local/boost_1_59_0/bin.v2/libs/system/build/msvc-14.0/debug/link-static/threading-multi/ -llibboost_system-vc140-mt-gd-1_59d INCLUDEPATH += $$PWD/../../../local/boost_1_59_0 DEPENDPATH += $$PWD/../../../local/boost_1_59_0 win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../local/boost_1_59_0/bin.v2/libs/system/build/msvc-14.0/debug/link-static/threading-multi/liblibboost_system-vc140-mt-gd-1_59.a else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../local/boost_1_59_0/bin.v2/libs/system/build/msvc-14.0/debug/link-static/threading-multi/liblibboost_system-vc140-mt-gd-1_59d.a else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../local/boost_1_59_0/bin.v2/libs/system/build/msvc-14.0/debug/link-static/threading-multi/libboost_system-vc140-mt-gd-1_59.lib else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../local/boost_1_59_0/bin.v2/libs/system/build/msvc-14.0/debug/link-static/threading-multi/libboost_system-vc140-mt-gd-1_59d.lib 

Mistake:

 E:\Projects\qt\mngProj\mng_driver\include\bsoncxx\v_noabi\bsoncxx\stdx\string_view.hpp:37: ошибка: C1083: Не удается открыть файл включение: boost/utility/string_ref.hpp: No such file or directory 

    2 answers 2

    Add INCLUDEPATH += $$PWD/../../../local/boost_1_59_0/

    • This line is already present - const.alexander
    • @ user3573700, then try to register the full path, without PWD and colons - ixSci
    • I tried this too - const.alexander
    • @ user3573700, then check that there really is this heading along this path. After all, there are no miracles in development, if you say that you have done everything in this way, then this error will not happen. - ixSci
    • @ user3573700, still try to completely clear the directory into which qmake generated files and try to make a clean build. Only clean not from qtcreator, but with your hands. - ixSci

    So many thanks @ixSci. I did not understand why, but I have to manually remove the build compiled by qt creator. The project successfully completed the linking stage with the following .pro file:

     SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -lbson-1.0 LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -lbson-static-1.0 LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -lmongoc-1.0 LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -lmongoc-static-1.0 LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -lbsoncxx LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -lmongocxx INCLUDEPATH += $$PWD/mng_driver/include/libbson-1.0 DEPENDPATH += $$PWD/mng_driver/include/libbson-1.0 INCLUDEPATH += $$PWD/mng_driver/include/libmongoc-1.0 DEPENDPATH += $$PWD/mng_driver/include/libmongoc-1.0 INCLUDEPATH += $$PWD/../../../mongo-c-driver/include/bsoncxx/v_noabi DEPENDPATH += $$PWD/../../../mongo-c-driver/include/bsoncxx/v_noabi INCLUDEPATH += $$PWD/../../../mongo-c-driver/include/mongocxx/v_noabi DEPENDPATH += $$PWD/../../../mongo-c-driver/include/mongocxx/v_noabi INCLUDEPATH += E:/local/boost_1_59_0/ DEPENDPATH += E:/local/boost_1_59_0/ win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -llibbsoncxx win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../mongo-c-driver/lib/libbsoncxx.lib win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../mongo-c-driver/lib/ -llibmongocxx win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../mongo-c-driver/lib/libmongocxx.lib