首页 > 解决方案 > Qt qmake windows中的链接龙框架

问题描述

我想从 Dragon Framework 编译 HelloWorld 示例,但我无法将库 boost 库链接到文件 .pro 中的项目。我在库文件中有编译错误,因为“boost/utility/string_view 没有这样的文件或目录”。

这是一个错误

E:\dev\vcpkg\installed\x86-windows\include\drogon\utils\string_view.h:19: błąd: boost/utility/string_view.hpp: No such file or directory
In file included from E:/dev/vcpkg/installed/x86-windows/include/drogon/HttpRequest.h:18:0,
                 from E:/dev/vcpkg/installed/x86-windows/include/drogon/HttpBinder.h:24,
                 from E:/dev/vcpkg/installed/x86-windows/include/drogon/HttpAppFramework.h:21,
                 from E:/dev/vcpkg/installed/x86-windows/include/drogon/HttpController.h:19,
                 from ../dragonTest/HelloController.cc:1:
E:/dev/vcpkg/installed/x86-windows/include/drogon/utils/string_view.h:19:10: fatal error: boost/utility/string_view.hpp: No such file or directory
 #include <boost/utility/string_view.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QT -= gui

CONFIG += c++14 console
CONFIG -= app_bundle

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
        HelloController.cc \
        HelloViewController.cc \
        main.cpp

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

INCLUDEPATH +=  "E:/dev/boost/include" \
                "E:/dev/vcpkg/installed/x86-windows/include"

DEPENDPATH +=   "E:/dev/boost/include" \
                "E:/dev/vcpkg/installed/x86-windows/include"

LIBS += -L"E:/dev/vcpkg/installed/x86-windows/lib/" -ldrogon -lzlib

我尝试将 boost 目录复制到 Dragon 框架内部,但即使这样也不起作用。

标签: c++qtboostqmake

解决方案


推荐阅读