我可能错过了一些简单的东西,但我无法真正弄清楚。
这是来自 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
?
最佳答案
我能够通过删除 -x
和 c++
之间的空格来使用 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/