gpt4 book ai didi

c++ - 为 Qt WebAssembly 编译虚拟键盘

转载 作者:行者123 更新时间:2023-12-03 18:53:37 30 4
gpt4 key购买 nike

我正在尝试从 QtCreator 编译虚拟键盘项目示例在 WebAssembly .
编译 wasm 库必须静态链接。根据docs :

Static builds

The virtual keyboard can be built and linked statically against theapplication. This implies that Qt is also built statically (using the-static option in the configure command line).

Static builds of the virtual keyboard are enabled by addingCONFIG+=static to the qmake command line and then rebuilding.

Some third party modules used by the virtual keyboard are always builtas shared libraries. These modules are Hunspell and 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: ...
我错过了什么还是它是一种错误?

最佳答案

您可以使用 -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

关于c++ - 为 Qt WebAssembly 编译虚拟键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66388835/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com