js
wangxuan19922
这个作者很懒,什么都没留下…
展开
-
Embind用于将C ++和JavaScript交互
EmbindEmbindis used to bind C++ functions and classes to JavaScript, so that the compiled code can be used in a natural way by “normal” JavaScript.Embindalso supportscalling JavaScript classes from C++.Embind has support for binding most C++ constr...转载 2020-07-01 12:08:24 · 1505 阅读 · 0 评论 -
WebAssembly编译出来的.wasm文件js如何调用
c代码char* toChar (char* str) { return str;}int add (int x, int y) { return x + y;}int square (int x) { return x * x;}然后执行emcc hello.c -Os -s WASM=1 -s SIDE_MODULE=1 -o hello.wasm编译出wasm文件新建hello.html加入调用的方法如下:<!DOCTYPE html>原创 2020-06-10 16:20:31 · 5308 阅读 · 2 评论