I think you might have a bug somewhere in your compilation toolchain. Make sure that it does not accidentally include system libraries / headers instead of choosing emscripten. Also make sure that you do not accidentally use your systems.
If you do emcc -v test.cpp (assuming test.cpp is your file that you are compiling), it should specify exactly which headers llvm / clang and node will rely on. Below you can see that the emcc command is faster by default than the cang clang native code (this may seem unexpected, but V8 is run-time optimization, C ++ is not.)
slcmew-nmx2499:Downloads trevor.linton$ gcc test.cpp slcmew-nmx2499:Downloads trevor.linton$ ./a.out Time taken: 2.33s slcmew-nmx2499:Downloads trevor.linton$ emcc test.cpp slcmew-nmx2499:Downloads trevor.linton$ node a.out.js Time taken: 1.17s slcmew-nmx2499:Downloads trevor.linton$
Lastly, make sure you are using the latest and greatest update. / emsdk and then. / emsdk install the latest version of 64 bit. This has been tested with node 0.10.21 and emscripten 1.16 on MacOS X Mavericks.
source share