getting started with enscripten



Please make sure you have python 2.7 above installed in your computer. And git too.

git clone https://github.com/juj/emsdk.git

Next, type python to make sure you have it your path. 


cd emsdk

emsdk.bat install latest


emsdk activate latest


If you type emcc on your command prompt you should be able see some program running asking for file input. This file is located inside the following path :- emsdk\emscripten\1.38.20


Save the following into a file called test.c

/*
 * Copyright 2011 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

#include 

int main() {
  printf("hello, world!\n");
  return 0;
}

Next compile it using the following command :-

emcc test.c -o test\hello.html


Since we can't see html files from our browser directly, we can spin up an instance of a web server using python.

cd test

Some tutorial might ask you to run using python but you can directly use the following exe called emrun


emrun --no_browser --port 8080 .

Then browse to http://localhost:8080/hello.html

To explore more porting example and demos, visit :- https://github.com/kripken/emscripten/wiki/Porting-Examples-and-Demos



Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm