如何解决从 Qt6 链接 CorePrivate
我正在使用 QtHttpServer(来自 Qt6)编写服务器。现在是使用网络套接字为系统实现聊天的时候了,但它还没有被添加到 Qt6 中。我看到了两种出路——要么使用 long-pulling 而不是 web sockets,要么从 qt5 下载 web sockets 代码并将其添加到项目中。我决定先尝试第二个选项,但我遇到了一个问题——该项目使用 QObjectPrivate。我知道它是 CorePrivate 库的一部分。我试图链接它,但没有奏效。你能告诉我这是否可以在 Qt6 中以某种方式解决吗?
cmake:
find_package(Qt6 COMPONENTS CorePrivate Core Network Sql HttpServer REQUIRED)
...
add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES})
target_link_libraries(${PROJECT_NAME} Qt6::CorePrivate Qt6::Core Qt6::Network Qt6::Sql Qt6::HttpServer)
错误:
CMake Error at CMakeLists.txt:12 (find_package):
Found package configuration file:
/usr/local/opt/qt/lib/cmake/Qt6/Qt6Config.cmake
but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
FOUND. Reason given by package:
Failed to find Qt component "CorePrivate" config file at ""
Failed to find Qt component "Core" config file at ""
Failed to find Qt component "Network" config file at ""
Failed to find Qt component "Sql" config file at ""
Failed to find Qt component "HttpServer" config file at ""
没有 CorePrivate cmake 运行成功。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。