I am likely missing something simple but I can’t really figure it out.
This is from the makefile:
box2d.clean.h:
cpp -x c++ -DEM_NO_LIBCPP -IBox2D_v2.2.1 root.h > box2d.clean.h
Let’s take a look at 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>
Okay. Yes I see that we are preventing the inclusion of several headers by defining their include guards. Headers like <Features.h>.
My questions:
What purpose might preventing the inclusion of these headers serve?
What command should cpp be aliased to? On my machine I see this output:
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
Why would gcc be looking for c?
I was able to solve the problem with the
cppcommand by removing the space between-xandc++.cpp -xc++ -DEM_NO_LIBCPP -IBox2D_v2.2.1 root.h > box2d.clean.h