2016-05-08 7 views
-1

Ich habe ein Problem. Ich habe den MongoDB-Treiber (mit msvc14) erstellt und mit dem qt-Ersteller verbunden. Aber es braucht Boost-Bibliothek. Und dann habe ich es zu meiner .proDatei fügte hinzu, es zeigte mir eine Fehlermeldung:Link Boost zu qt Schöpfer

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 

Ich habe versucht, Header-Dateien zu lokalisieren und boost zu bauen und lokalisieren Bibliothek von Systemverzeichnis und alle Bibliotheken zu finden, von“.../Bühne/lib ". Aber nichts ist passiert. Meine .pro Datei:

#------------------------------------------------- 
# 
# 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

Zunächst einmal, das ist kein Linker Fehler. Fügen Sie einen Include-Pfad zum Boosten hinzu. – LogicStuff

+0

Eine saubere, run qmake, und Neuerstellung in der Regel behebt diese Probleme. –

Antwort

0

Ok, das Problem ist gelöst. Ich weiß nicht, warum, aber Sie müssen Build-Ordner manuell löschen, und ich bestehen Link Bühne mit dieser .proDatei:

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