Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: unknown argument: '-nostdsysteminc' in Emscripten

Tags:

emscripten

I am reading through the tutorial for emscripten here - https://github.com/kripken/emscripten/wiki/Tutorial

So far, I have downloaded the source and installed the dependencies and set my .emscripten settings file appropriately.

Here are the settings:

# This file will be copied to ~/.emscripten if that file doesn't exist. Or, this is     that copy.
# IMPORTANT: Edit the *copy* with the right paths!

#EMSCRIPTEN_ROOT = os.path.expanduser('~/Dev/emscripten') # this helps projects using emscripten find it
EMSCRIPTEN_ROOT = os.path.expanduser('~/softwares/kripken-emscripten-12e45ea')

#LLVM_ROOT = os.path.expanduser('~/Dev/llvm-3.0/cbuild/bin')
LLVM_ROOT = os.path.expanduser('/usr/bin')

# See below for notes on which JS engine(s) you need
NODE_JS = 'node'
SPIDERMONKEY_ENGINE = [os.path.expanduser('~/Dev/mozilla-central/js/src/js'), '-m', '-n']
V8_ENGINE = os.path.expanduser('~/Dev/v8/d8')

TEMP_DIR = '/tmp'


########################################################################################################


# Pick the JS engine to use for running the compiler. This engine must exist, or
# nothing can be compiled.
#
# Recommendation: If you already have node installed, use that. Otherwise, build v8 or
#                 spidermonkey from source. Any of these three is fine, as long as it's
#                 a recent version (especially for v8 and spidermonkey).

COMPILER_ENGINE = NODE_JS
#COMPILER_ENGINE = V8_ENGINE
#COMPILER_ENGINE = SPIDERMONKEY_ENGINE


# All JS engines to use when running the automatic tests. Not all the engines in this list
# must exist (if they don't, they will be skipped in the test runner).
#
# Recommendation: If you already have node installed, use that. If you can, also build
#                 spidermonkey from source as well to get more test coverage (node can't
#                 run all the tests due to node issue 1669). v8 is currently not recommended
#                 here because of v8 issue 1822.

JS_ENGINES = [NODE_JS, SPIDERMONKEY_ENGINE]

But when I am running emcc in a test program which is in the tests directory with the command:

./emcc tests/hello_world.cpp

I am getting the error:

error: unknown argument: '-nostdsysteminc'
emcc: compiler frontend failed to generate LLVM bitcode, halting

I am unable to understand why this error is occurring.

like image 614
user1305317 Avatar asked Aug 10 '26 17:08

user1305317


1 Answers

It's likely you're using a version of clang that is prior to 3.0.

To check your version, run:

clang --version

I found that my version was 2.8, as I had installed via apt-get on Ubuntu 11.04; once I updated to clang 3.0, this error disappeared.

like image 97
Dave Cahill Avatar answered Aug 13 '26 22:08

Dave Cahill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!