我有问题。我构建了MongoDB驱动程序(使用msvc14)并将其连接到qt creator。但它需要提升库。然后我将它添加到我的.pro文件中,它显示了一个错误:
E:\Projects\qt\mngProj\mng_driver\include\bsoncxx\v_noabi\bsoncxx\stdx\string_view.hpp:37: error: C1083: Cannot open file: boost/utility/string_ref.hpp: No such file or directory
我试图找到头文件,并从系统目录构建boost和locate库,并找到来自" ... / stage / lib"的所有库。但什么都没发生。我的.pro文件:
#-------------------------------------------------
#
# Project created by QtCreator 2016-02-10T12:18:47
#
#-------------------------------------------------
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
答案 0 :(得分:0)
好的,问题解决了。 我不知道为什么,但你需要手动删除构建文件夹,我通过链接阶段与.pro文件:
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