【问题标题】:Compile Virtual Keyboard for Qt WebAssembly为 Qt WebAssembly 编译虚拟键盘
【发布时间】:2021-05-29 00:17:46
【问题描述】:

我正在尝试从QtCreator 编译WebAssembly 中的虚拟键盘项目示例。

要为 wasm 库编译必须静态链接。根据docs

静态构建

虚拟键盘可以构建并静态链接到 应用。这意味着 Qt 也是静态构建的(使用 配置命令行中的 -static 选项)。

通过添加启用虚拟键盘的静态构建 CONFIG+=static 到 qmake 命令行,然后重建。

虚拟键盘使用的一些第三方模块总是内置的 作为共享库。这些模块是 Hunspell 和 Lipi Toolkit。

这么说,我正在尝试编译

mkdir buildwasm && cd buildwasm
/opt/Qt/5.15.2/wasm_32/bin/qmake .. CONFIG+=static CONFIG+=disable-hunspell && make -j8

但不知何故,键盘没有静态链接,我收到此错误

wasm-ld: error: initial memory too small, 18699856 bytes needed
shared:ERROR: ...

是我遗漏了什么还是某种错误?

【问题讨论】:

    标签: c++ qt qml webassembly virtual-keyboard


    【解决方案1】:

    您可以使用-s TOTAL_MEMORY=32MB 编译器标志在 emcc 链接时预设大小。 相关问题:wasm-ld: error: initial memory too small, 18317952 bytes needed

    有一个默认的限制设置,设置为:16777216 https://github.com/emscripten-core/emscripten/blob/master/src/settings.js#L171

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-25
      • 2013-01-03
      • 2015-01-02
      相关资源
      最近更新 更多