javascript - Box2D Emscripten : what is box2d. clean.h,如何成功生成它?

标签 javascript c++ compilation box2d emscripten

我可能错过了一些简单的东西,但我无法真正弄清楚。

这是来自 the makefile :

box2d.clean.h:
    cpp -x c++ -DEM_NO_LIBCPP -IBox2D_v2.2.1 root.h > box2d.clean.h

让我们看一下root.h :

// Prevent some inclusions
#define NDEBUG

#ifdef EM_NO_LIBCPP
#define _FEATURES_H
#define _GLIBCXX_CMATH
#define _GLIBCXX_CXX_CONFIG_H
#define _CPP_TYPE_TRAITS_H
#define _EXT_TYPE_TRAITS
#define _GLIBCXX_NUMERIC_LIMITS
#define __GNUC_PREREQ(x, y) 0
#define _STL_RELOPS_H
#define _STL_PAIR_H
#define _FUNCTEXCEPT_H
#define _EXT_NUMERIC_TRAITS
#define _STL_ITERATOR_BASE_TYPES_H
#define _STL_ITERATOR_H
#endif

#include <Box2D/Box2D.h>

好的。是的,我看到我们通过定义它们的包含防护来防止包含多个 header 。标题如 <Features.h>

我的问题:

阻止包含这些 header 的目的是什么?

应该使用什么命令cpp别名为?在我的机器上我看到这个输出:

cpp -x c++ -DEM_NO_LIBCPP -IBox2D_v2.2.1 root.h > box2d.clean.h
i686-apple-darwin11-llvm-gcc-4.2: c: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: c++: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: warning: '-x -x' after last input file has no effect
i686-apple-darwin11-llvm-gcc-4.2: no input files

为什么会gcc正在寻找c

最佳答案

我能够通过删除 -xc++ 之间的空格来使用 cpp 命令解决问题。

cpp -xc++ -DEM_NO_LIBCPP -IBox2D_v2.2.1 root.h > box2d.clean.h

关于javascript - Box2D Emscripten : what is box2d. clean.h,如何成功生成它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12851351/

相关文章:

javascript - Bootstrap 提前输入不起作用

c++ - 为什么fstream不利用operator>>的istream原型(prototype)?

c++ - WDK C++ 项目需要更改调试编译器严格性

java - 从Java源代码的编译消息中仅重定向错误消息

javascript - 高阶函数调用奇怪的行为

javascript - JavaScript 执行后检查 DOM 是否处于稳定状态(无事件回流/重绘)

c++ - 模板模板参数不是类型

java - 如何更改用户友好消息中的 UnsupportedClassVersionError?

javascript - 从表单更新 JSON 数组

c++ - 如何正确停止 g_main_loop_run?