p1xel
p1xel

Reputation: 304

emscripten issue with ubuntu version "aborting from js compiler due to exception: unknown vector type <4 x i8> | undefined"

I cannot compile anything with the current version of emscripten from the ubuntu repos

Here is the error

http://pastebin.com/j5Z0ztTs

I suspect it might be because emscripten is outdated in the repos, but why is there no bug reports??

Could anyone help? I cannot find any updated information.

Thanks in advance.

Upvotes: 0

Views: 463

Answers (1)

mike510a
mike510a

Reputation: 2168

The reason is because you are using the /usr/bin/clang++ that comes with your Linux distribution.

This version does not support Javascript backend. In order to use emscripten, you have to compile fastcomp (an LLVM clang compiler with Javascript backend added)

If you have not built fastcomp yet, Emscripten won't work.

Check out this page for installation instructions:

http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html


If you have already built fastcomp, then the problem is in your emscriptenrc file, and moreover your PATH.

This is how I worked around the issue:

I created a file called emscriptenrc.sh that did this:

export PATH=/home/mike/emscripten/fastcomp/build/master/bin:/home/mike/emscripten/fastcomp/build/master/include:/home/mike/emscripten/fastcomp/build/master/lib:$PATH

then after I created that file

I rebuilt the ~/.emscripten configuration file by calling

./emcc -v from the emscripten build directory -- this seemed to get the right version of clang registered...

now you can go ahead and compile with emcc

I would suggest reading http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html as well as the rest of the documentation prior to trying to use emscripten.

Upvotes: 1

Related Questions