环境安装(windows)

  1. 需要安装git,node,最新的python,并配置环境变量。
  2. 安装emscripten: 在目录下打开git窗口,执行以下命令:
    1).克隆emsdkgit clone https://github.com/juj/emsdk.git
    2).进入emsdk文件夹cd emsdk
    3).更新emsdk./emsdk update
    3).更新emsdkgit pull
    4).安装最新的emsdk 并配置全局的环境变量./emsdk install --global latest
    5).激活./emsdk activate latest
  3. “hello world”:
    1.)将 Emscripten 的环境变量配置到当前的命令行窗口下source ./emsdk_env.sh
    2.)mkdir hellocd hellovim hello.c
    3.) 编写:#include <stdio.h> int main(int argc, char ** argv) { printf("hello, world!\n"); }
    4.)编译emcc hello.c -s WASM=1 -o hello.html
    5.)启动服务:emrun --no_browser --port 8080
    6.)浏览器打开服务,点击'hello.html',就能看到“hello,world!”

相关文章:

  • 2021-07-20
  • 2021-06-12
  • 2021-07-07
  • 2021-10-21
  • 2022-12-23
  • 2021-12-02
  • 2021-11-30
猜你喜欢
  • 2021-04-12
  • 2021-09-03
  • 2021-07-23
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2022-02-02
相关资源
相似解决方案