Build error: Ammo.js by Emscripten on Mac OsX

298 views Asked by At

I have the problem to build ammo.js on Mac. ( OS is Maverick ). It doesn't compile C++ code and nothing in bindings.cpp code in /build folder.

I followed the procedure in this link. Here is the 1st log I got.

==========================
Stage 1: Generate bindings
==========================

Preprocessing...
clang: error: language not recognized: '-x'
clang: error: no such file or directory: 'c'
clang: error: no such file or directory: 'c++'
clang: error: no input files
Cleaning...
Processing...

I know MacOSX includes clang compiler but emscripten guid forced to install llvm compiler from llvm repository. I wonder how I can fix it. Somebody said MacOsX has the issue to run emscripten. But I wonder it is right or not.

======UPDATE=====

I found 'cpp' called Apple's LLVM, not my own built LLVM in make.py file. In make.py file,

Old code

Popen(['cpp', '-x', 'c++', '-I../src', '../../root.h'], stdout=open('headers.pre.h', 'w')).communicate()

Changed code

Popen(['clang++', '-x', 'c++', '-I../src', '../../root.h' ], stdout=open('headers.pre.h', 'w')).communicate()

But still problem happens even I changed make.py. Error messages are below.

==========================
Stage 1: Generate bindings
==========================

Preprocessing...
In file included from ../../root.h:1:
In file included from ../../project/src/btBulletDynamicsCommon.h:20:
In file included from ../src/btBulletCollisionCommon.h:22:
In file included from ../src/BulletCollision/CollisionDispatch/btCollisionWorld.h:80:
In file included from ../src/LinearMath/btVector3.h:21:
../src/LinearMath/btScalar.h:26:10: fatal error: 'math.h' file not found
#include <math.h>
         ^
1 error generated.
Cleaning...
Processing...

I wonder how I can fix it.

0

There are 0 answers