c++ - 将 Boost 正确安装到 Qt 中(当前失败,权限被拒绝)

标签 c++ qt boost

我想做的是将 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:\Qt\Qt5.4.1\Tools\mingw491_32\bin\mingw32-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 debug\boostQtExample.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:\mingw491\mingw32\lib -LC:\Utils\icu32_53_1_mingw482\lib -LC:\utils\postgresql\pgsql\lib -LC:\utils\mysql\mysql\lib -LC:\opensll\lib -lshell32 -LC:\Qt\Qt5.4.1\5.4\mingw491_32/lib -LC:\releases\lib\boost\boost_qt\stage\lib\ / -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 'debug\boostQtExample.exe' failed
mingw32-make[1]: *** [debug\boostQtExample.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:\Qt\Qt5.4.1\Tools\mingw491_32\bin\mingw32-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:\Qt\5.4\mingw491_32\bin;C:\releases\lib\boost\boost_qt\stage\lib)。

#
# 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:\releases\lib\boost\boost_qt


LIBS += -LC:\releases\lib\boost\boost_qt\stage\lib\ \
        -lboost_datetime

SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

有人对我还缺少什么有什么建议吗?

最佳答案

将 LIBS +=/更改为 LIBS +=\解决了这个问题。然而,现在只是报告“:-1:错误:找不到-lboost_datetime”。将创建一个新问题来解决这个问题。

关于c++ - 将 Boost 正确安装到 Qt 中(当前失败,权限被拒绝),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30458319/

相关文章:

c++ - 如何在 cmake 中使用 QML_ELEMENT

c++ - 是否有任何关于 Boost 库 C++ 和 C++ 中的面向对象设计的好书?

c++ - 使用信号和线程的事件管理器

c++ - 子解析器属性

android - 确定套接字何时在 Android 上关闭

c++ - "boost::mpl::identity<T>::type"在这里有什么意义?

c++ - 如何为 QGraphicsSimpleTextItem (Qt C++) 设置背景?

c++ - Qt 和自定义分配器

c++ - 为什么 std::make_move_iterator 适用于 vector<string> 但不适用于 vector<int>

c++ - 在专用和非专用模板化结构之间共享代码