使用WebAssembly配置QT问题:在Qt6ProtobufTools上失败,找不到WrapProtoc

问题描述 投票:0回答:2

这就是我所做和尝试的, 我安装了QT 6.5.2,我还下载了emsdk 我通过

安装并激活emsdk
./emsdk install 3.1.25
./emsdk activate 3.1.25

然后我进入了位于 C:\Qt .5.2\Src 的 QT 源文件夹 并运行配置

./configure.bat -qt-host-path C:\Qt\6.5.2\mingw_64 -no-warnings-are-errors -feature-opengles3  -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -platform wasm-emscripten -prefix $PWD/qtbase

我收到以下错误

-- Configuring submodule 'qtwebengine'
[QtWebEngine] -- Support check for QtWebEngine failed: Build can be done only on Linux, Windows or macOS.
[QtWebEngine] -- Support check for QtPdf failed: Build can be done only on Linux, Windows, macO, iOS and Android(on non-Windows hosts only).
-- Configuring submodule 'qtdoc'
-- Configuring submodule 'qtgrpc'
CMake Warning at qtgrpc/src/tools/host/CMakeLists.txt:20 (find_package):
  Found package configuration file:

    C:/Qt/6.5.2/mingw_64/lib/cmake/Qt6ProtobufTools/Qt6ProtobufToolsConfig.cmake

  but it set Qt6ProtobufTools_FOUND to FALSE so package "Qt6ProtobufTools" is
  considered to be NOT FOUND.  Reason given by package:

  Qt6ProtobufTools could not be found because dependency WrapProtoc could not
  be found.



CMake Warning at qtgrpc/src/tools/host/CMakeLists.txt:28 (find_package):
  Found package configuration file:

    C:/Qt/6.5.2/mingw_64/lib/cmake/Qt6GrpcTools/Qt6GrpcToolsConfig.cmake

  but it set Qt6GrpcTools_FOUND to FALSE so package "Qt6GrpcTools" is
  considered to be NOT FOUND.  Reason given by package:

  Qt6GrpcTools could not be found because dependency WrapProtoc could not be
  found.



CMake Error at qtbase/cmake/QtPublicTargetHelpers.cmake:257 (get_property):
  get_property could not find TARGET Qt6::qtprotobufgen.  Perhaps it has not
  yet been created.
Call Stack (most recent call first):
  C:/Qt/6.5.2/mingw_64/lib/cmake/Qt6ProtobufTools/Qt6ProtobufToolsConfig.cmake:56 (__qt_internal_promote_target_to_global)
  qtbase/cmake/QtToolHelpers.cmake:642 (find_package)
  qtbase/cmake/QtToolHelpers.cmake:72 (qt_internal_find_tool)
  qtgrpc/src/tools/qtprotobufgen/CMakeLists.txt:5 (qt_internal_add_tool)


CMake Warning at qtbase/cmake/QtToolHelpers.cmake:642 (find_package):
  Found package configuration file:

    C:/Qt/6.5.2/mingw_64/lib/cmake/Qt6ProtobufTools/Qt6ProtobufToolsConfig.cmake

  but it set Qt6ProtobufTools_FOUND to FALSE so package "Qt6ProtobufTools" is
  considered to be NOT FOUND.  Reason given by package:

  Qt6ProtobufTools could not be found because dependency WrapProtoc could not
  be found.

Call Stack (most recent call first):
  qtbase/cmake/QtToolHelpers.cmake:72 (qt_internal_find_tool)
  qtgrpc/src/tools/qtprotobufgen/CMakeLists.txt:5 (qt_internal_add_tool)


CMake Error at qtbase/cmake/QtToolHelpers.cmake:684 (message):
  Failed to find the host tool "Qt6::qtprotobufgen".  It is part of the
  Qt6ProtobufTools package, but the package could not be found.  Make sure
  you have built and installed the host Protobuf module, which will ensure
  the creation of the Qt6ProtobufTools package.
Call Stack (most recent call first):
  qtbase/cmake/QtToolHelpers.cmake:72 (qt_internal_find_tool)
  qtgrpc/src/tools/qtprotobufgen/CMakeLists.txt:5 (qt_internal_add_tool)


-- Configuring incomplete, errors occurred!
See also "C:/Qt/6.5.2/Src/CMakeFiles/CMakeOutput.log".
See also "C:/Qt/6.5.2/Src/CMakeFiles/CMakeError.log".
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:998 (message):
  CMake exited with code 1.

我已经检查了我的 QT 安装并确认 QT 所需的一切都已安装 enter image description here

谷歌搜索错误没有产生好的结果。 我在这里缺少什么并且需要做什么?

qt cmake webassembly
2个回答
0
投票

apt install protobuf-compiler
为我解决了类似的问题。


0
投票

作为解决方法,请尝试将“-skip qtgrpc”添加到 ./configure.bat 或使用 Qt 维护工具删除 Qt Protobuf 库。

© www.soinside.com 2019 - 2024. All rights reserved.