Skip to content

Instantly share code, notes, and snippets.

@kyorohiro
Created December 28, 2017 17:06
Show Gist options
  • Save kyorohiro/41cc525da6614e67ce161943890803d5 to your computer and use it in GitHub Desktop.
Save kyorohiro/41cc525da6614e67ce161943890803d5 to your computer and use it in GitHub Desktop.
$emacs main.c
$emcc main.c
include<stdio.h>
int main() {
printf("Hello World!!");
return 0;
}
$emcc main.c
$ls
a.out.js main.c
$ node a.out.js
stdio streams had content in them that was not flushed.
you should set NO_EXIT_RUNTIME to 0 (see the FAQ), or make
sure to emit a newline when you printf etc.
$ emcc main.c -s NO_EXIT_RUNTIME=0
$ node a.out.js
Hello World!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment