错误:未知参数:Emscripten 中的“-nostdsysteminc”

Posted

技术标签:

【中文标题】错误:未知参数:Emscripten 中的“-nostdsysteminc”【英文标题】:Error: unknown argument: '-nostdsysteminc' in Emscripten 【发布时间】:2012-04-05 19:49:23 【问题描述】:

我正在阅读 emscripten 的教程 - https://github.com/kripken/emscripten/wiki/Tutorial

到目前为止,我已经下载了源代码并安装了依赖项并正确设置了我的 .emscripten 设置文件。

以下是设置:

# 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]

但是当我在测试目录中的测试程序中运行 emcc 时,使用以下命令:

./emcc tests/hello_world.cpp

我收到错误:

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

我无法理解为什么会发生此错误。

【问题讨论】:

【参考方案1】:

您可能使用的是 3.0 之前的 clang 版本。

要检查您的版本,请运行:

clang --version

我发现我的版本是 2.8,因为我是在 Ubuntu 11.04 上通过 apt-get 安装的;一旦我更新到 clang 3.0,这个错误就消失了。

【讨论】:

以上是关于错误:未知参数:Emscripten 中的“-nostdsysteminc”的主要内容,如果未能解决你的问题,请参考以下文章

Emscripten 中的 C++11 支持

DataTables 警告(表 id = 'table-filter'):从数据源请求未知参数 '0' 用于数据表中的第 0 行错误

EParseError wamp:配置文件在第 592 行包含语法错误。未知参数名称“类型”

将文件名传递给 Emscripten 生成的 js 作为参数

获取错误“未知”类型的参数不能分配给“错误”类型的参数 |空值'

将命令行参数传递给 emscripten 生成的应用程序