- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经使用最新版本的 Emscripten 尝试了此处的说明:https://github.com/kripken/gmp.js/blob/master/README.markdown
.a 文件似乎已正确创建。然后我尝试针对该库进行编译(在 Debug模式下),这似乎有效:
emcc invocation: /home/marcosscriven/sources/emscripten/emcc -O0 --closure 0 test.c .libs/libgmp.a -o complete.js
(Emscripten: Running sanity checks)
emcc: compiling to bitcode
emcc: compiling source file: test.c
emcc running: /usr/local/bin/clang -m32 -U__i386__ -U__x86_64__ -U__i386 -U__x86_64 -Ui386 -Ux86_64 -U__SSE__ -U__SSE2__ -U__MMX__ -UX87_DOUBLE_ROUNDING -UHAVE_GCC_ASM_FOR_X87 -DEMSCRIPTEN -U__STRICT_ANSI__ -U__CYGWIN__ -D__STDC__ -Xclang -triple=i386-pc-linux-gnu -D__IEEE_LITTLE_ENDIAN -fno-math-errno -fno-ms-compatibility -nostdinc -Xclang -nobuiltininc -Xclang -nostdsysteminc -Xclang -isystem/home/marcosscriven/sources/emscripten/system/local/include -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include/emscripten -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include/bsd -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include/libc -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include/libcxx -Xclang -isystem/home/marcosscriven/sources/emscripten/system/lib/libcxxabi/include -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include/gfx -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include/net -Xclang -isystem/home/marcosscriven/sources/emscripten/system/include/SDL -U__APPLE__ -U__linux__ -D_LIBCPP_HAS_NO_DELETED_FUNCTIONS -emit-llvm -c test.c -o /tmp/tmp_pOV54/test_0.o
emcc: copying library file: .libs/libgmp.a
emcc: will generate JavaScript
emcc: considering including libcxx: we need set([]) and have set([])
emcc: considering including libcxxabi: we need set([]) and have set([])
emcc: considering including libc: we need set(['realloc', 'malloc', 'memcpy', 'free']) and have set([])
emcc: including libc
emcc: linking: ['/tmp/tmp_pOV54/test_0.o', '/tmp/tmp_pOV54/libgmp_1.a', '/home/marcosscriven/.emscripten_cache/libc.bc']
emcc: llvm-linking: ['/tmp/tmp_pOV54/test_0.o', '/home/marcosscriven/.emscripten_cache/libc.bc']
emcc: saving intermediate processing steps to /tmp/emscripten_temp
emcc: LLVM opts: ['-internalize', '-internalize-public-api-list=main', '-globaldce']
emcc: step took 0.01 seconds
emcc: step took 0.00 seconds
emcc: LLVM => JS
emscript: ll=>js
emscript: scan took 0.000277042388916 seconds
emscript: split took 0.000169038772583 seconds
emscript: phase 1 took 0.173984050751 seconds
emscript: phase 2 working on 1 chunks (intended chunk size: 1.00 MB, meta: 0.00 MB, forwarded: 0.01 MB, total: 0.01 MB)
emscript: phase 2 took 0.206316947937 seconds
emscript: phase 2b took 0.000115871429443 seconds
emscript: phase 2c took 0.00135588645935 seconds
emscript: phase 3 took 0.170216083527 seconds
emcc: step took 0.60 seconds
emcc: total time: 1.62 seconds
marcosscriven@ubuntu-laptop:~/sources/gmp-5.0.2$ node complete.js
/home/marcosscriven/sources/gmp-5.0.2/complete.js:2452
___gmpz_init(((5242892)|0));
^
TypeError: undefined is not a function
at _pidigits (/home/marcosscriven/sources/gmp-5.0.2/complete.js:2452:7)
at Object._main (/home/marcosscriven/sources/gmp-5.0.2/complete.js:2429:7)
at Object.callMain (/home/marcosscriven/sources/gmp-5.0.2/complete.js:2644:24)
at doRun (/home/marcosscriven/sources/gmp-5.0.2/complete.js:2679:20)
at run (/home/marcosscriven/sources/gmp-5.0.2/complete.js:2703:12)
at Object.<anonymous> (/home/marcosscriven/sources/gmp-5.0.2/complete.js:2725:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
marcosscriven@ubuntu-laptop:~/sources/gmp-5.0.2$ !llvm-nm
llvm-nm .libs/libgmp.a | grep gmpz_init
00000000 T __gmpz_init
00000000 T __gmpz_init2
U __gmpz_init
00000000 T __gmpz_inits
00000000 T __gmpz_init_set
00000000 T __gmpz_init_set_d
00000000 T __gmpz_init_set_si
00000000 T __gmpz_init_set_str
00000000 T __gmpz_init_set_ui
U __gmpz_init
U __gmpz_init_set_ui
U __gmpz_init2
U __gmpz_init_set_ui
U __gmpz_init
U __gmpz_init_set_str
U __gmpz_init
U __gmpz_init2
U __gmpz_init_set
U __gmpz_init
U __gmpz_init_set
最佳答案
我最终得到了这个工作。 (实际上也适用于 MPFR)。
最大的问题是确保使用 32 位选项和 header 。
关于llvm - 无法使用 Emscripten 编译 GMP lib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15024882/
我需要将什么添加到我的 CMakeLists.txt 文件中,以便下面的示例来自 here还能建吗? 我可以毫无问题地生成 WASM,但不知道要在我的 CMakeLists.txt 中添加什么以停止出
我很好奇 emscripten 是否可以在没有 libc 的情况下构建二进制文件。 如果我有 simple.c: int add1(int x) { return x + 1; } 而且我不想
我已经研究了一段时间,我似乎无法找到如何实现这一点。 有一个非常明确的标题 emscripten_get_canvas_size,它没有做我期望它做的事情。实际的 Emscripten Canvas
Emscripten 教程很好地解释了如何与 C 函数交互:https://github.com/kripken/emscripten/wiki/Interacting-with-code 但是你如何
我对 WebAssembly 非常感兴趣,但我感到沮丧的是,即使是用 C++ 编码并使用 Emscripten 编译的“Hello World”示例,也会在浏览器中加载总共 396KB。是什么赋予了?
game engine我用来运行我的 game在浏览器中运行 lua 并在我的游戏中使用正常的 fopen/write/fclose 保存文件。引擎C/C++代码通过emscripten编译为JS。让
当使用不带任何参数的 emscripten 编译 C++ 时,除了 webgl Canvas 之外,它还会生成一个带有控制台和 emscripten Logo 的 html 文件。 是否可以禁用 Lo
我在 emscripten 中有一个 hello world 代码。如果可能的话,我想用 visual studio code 调试它并设置断点和调试更容易。我尝试这样做,但我无法在断点处停止。我使用
我正在阅读这里的 emscripten 教程 - https://github.com/kripken/emscripten/wiki/Tutorial 到目前为止,我已经下载了源代码并安装了依赖项并
是否可以使用 Emscripten 优化构建/编译 Opus/libopus?我不确定这是否是 Emscripten 和 WebAssembly 的一般当前限制,或者是否存在确保解码器在 WebAss
在 Emscripten wiki ( Interacting with code ) 中,只有两种类型被列为要传递给 ccall 的可能返回类型。或 cwrap (“数字”和“字符串”)。如何包装/
如何使用 emcmake cmake 并传递 emscripten 命令行选项? C++/CMake 的新手,但在谷歌上找不到任何有用的东西。所以也许这个问题只是愚蠢的,在那种情况下我道歉。 我可以使
我是 opencv.js 的新手。我在构建 opencv.js 时遇到了一些问题我正在使用 Windows 10。我按照以下步骤设置 opencv.js https://docs.opencv.org
我无法在另一个 JavaScript 文件中调用 C 函数,它给出了错误“在运行时初始化之前调用”please refer to this link 我按照给定链接中的描述在 emscripten 中
我正在尝试使用 Emscripten 构建一个使用 ffmpeg 库到 WebAssembly 的小项目。在此之前,我通过将一些简单的程序从 C 转换为 Wasm 来进行尝试,它运行良好,但那时我没有
我正在尝试将线程与 Emscripten 一起使用,但我不明白它是如何工作的。我已经阅读了一些关于网络 worker 的文字,但我不确定是否理解。 当我查看“tests”文件夹时,I can see
我正在运行一个使用 emscripten 编译为 wasm 的 C 工具。该工具适用于非常大的文件。在 CLI 上正常运行此工具时,操作通常会流式传输结果并在返回足够的数据后提前终止程序。例如,您可能
Mono 有一个 LLVM编译器。无论如何可以将它与 Emscripten 一起使用吗? (将 C# 代码编译为 JavaScript)? 最佳答案 目前没有现成的方法可以做到这一点。这也许是可能的,
我通过以下步骤安装了 Emscripten: 1.) Download the emsdk-portable version for Linux/MacOSX http://kripken.githu
我是 Emscripten/javascript 的新手,如果我的情况已经得到解决,我提前道歉。我在 ionic3 中有一个应用程序,我想读取 c 中有 3 个位置的数组,这个位置有其他数组,在结构上
我是一名优秀的程序员,十分优秀!