【Rust/WebAssembly】これが出たら。error: could not exec the linker `emcc`: No such file or directory (os error 2)
WebAssemblyを使ってRustのコードをブラウザ上で実行させたくて出たError。
これをやったら
./emsdk install sdk-incoming-64bit
を実行したら
error: could not exec the linker `emcc`: No such file or directory (os error 2)
が出て、そんなファイルやディレクトリねー。
て言われた。
1.
brew install CMake
2.
$ ./emsdk install sdk-incoming-64bit
やって見たけど
コンパイルするとエラー。。
https://kripken.github.io/emscripten-site/docs/tools_reference/emsdk.html
これだ。。
この中に書いてある。
./emsdk install git-1.8.3 clang-incoming-64bit node-0.10.17-64bit python-2.7.5.3-64bit java-7.45-64bit emscripten-incoming
これを実行してください。
git-1.8.3がない!とか言われたら
それはインストールせず、
./emsdk install clang-incoming-64bit node-0.10.17-64bit python-2.7.5.3-64bit java-7.45-64bit emscripten-incoming
で
./emsdk list
リスト表示
今ダウンロ
source ./emsdk_env.sh
更新
![source ./emsdk_env.sh](https://kenjimorita.jp/wp-content/uploads/2017/06/1d7c289172e4e9a91e4ecb3c7a98bfca-1024x386.png)
PATHが通ったことを確認。
これ。
そして再度、
rustc --target=wasm32-unknown-emscripten hello.rs -o hello.js
とか
rustc --target=wasm32-unknown-emscripten hello.rs -o hello.html
とか
emsdk-portable/の直下にhello.rsがあることを確認して
cd /emsdk-portable
で打ってください。。
生成できた。。