
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
예제 작성
#include <iostream>
int main() {
std::cout << "[WASM] Loaded" << std::endl;
std::cout << "Hello World" << std::endl;
}
em++ main.cpp -o index.html
http-server .
Access to XMLHttpRequest at 'file:///goinfre/sejpark/wasm_prac/index.wasm' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.

출처: