正确地将Boost安装到Qt中(当前无法获得许可)

Install Boost correctly into Qt (failing currently with permission denied)

本文关键字:许可 Boost 安装 Qt 正确地      更新时间:2023-10-16

我想做的是正确地将Boost安装到Qt中,以便我可以在任何Qt程序中使用它。

然而,目前的建设失败与这些问题:

cannot find /: Permission denied
error: ld returned 1 exit status

编译输出:

12:55:12: Running steps for project boostQtExample...
12:55:12: Configuration unchanged, skipping qmake step.
12:55:12: Starting: "C:QtQt5.4.1Toolsmingw491_32binmingw32-make.exe"
C:/Qt/Qt5.4.1/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/Nick.CSM3D/Downloads/build-boostQtExample-Desktop_Qt_5_4_1_MinGW_32bit-Debug'
g++ -Wl,-subsystem,windows -mthreads -o debugboostQtExample.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -LC:/Qt/Qt5.4.1/5.4/mingw491_32/lib -lqtmaind -LC:mingw491mingw32lib -LC:Utilsicu32_53_1_mingw482lib -LC:utilspostgresqlpgsqllib -LC:utilsmysqlmysqllib -LC:openslllib -lshell32 -LC:QtQt5.4.15.4mingw491_32/lib -LC:releaseslibboostboost_qtstagelib / -lQt5Widgetsd -lQt5Guid -lQt5Cored
C:/Qt/Qt5.4.1/Tools/mingw491_32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: cannot find /: Permission denied
collect2.exe: error: ld returned 1 exit status
Makefile.Debug:81: recipe for target 'debugboostQtExample.exe' failed
mingw32-make[1]: *** [debugboostQtExample.exe] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/Nick.CSM3D/Downloads/build-boostQtExample-Desktop_Qt_5_4_1_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
12:55:15: The process "C:QtQt5.4.1Toolsmingw491_32binmingw32-make.exe" exited with code 2.
Error while building/deploying project boostQtExample (kit: Desktop Qt 5.4.1 MinGW 32bit)
When executing step "Make"

Boost是通过使用这个网站一步一步的过程安装的,http://cpp-qt-mac-win.blogspot.co.uk/2011/10/qt-boost-for-beginners-step-by-step.html?view=mosaic,目前使用此页面的Qt示例来测试我的设置是否正在工作(它不是)。这包括库文件的构建,我还设置了windows中的环境变量(C:Qt5.4mingw491_32bin;C:releaseslibboostboost_qtstagelib)。

#
# Project created by QtCreator 2011-10-24T19:30:35
#
#-------------------------------------------------
QT       += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = boostQtExample
TEMPLATE = app
#Dont forget to add the path to your boost install folder
INCLUDEPATH += C:releaseslibboostboost_qt

LIBS += -LC:releaseslibboostboost_qtstagelib 
        -lboost_datetime
SOURCES += main.cpp
        mainwindow.cpp
HEADERS  += mainwindow.h
FORMS    += mainwindow.ui

谁有什么建议,我还错过了什么?

将LIBS +=/更改为LIBS += 解决了此问题。然而,现在只是报告":-1:error: cannot find -lboost_datetime"。将创建一个新问题来解决这个问题。