我在 Mac上构建ammo.js时遇到问题。(操作系统是小牛)。它不编译 C++ 代码,并且 /build 文件夹中的 bindings.cpp 代码中没有任何内容。
我按照此链接中的程序进行操作。这是我得到的第一个日志。
==========================
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...
我知道 MacOSX 包含 clang 编译器,但 emscripten guid 被迫从 llvm 存储库安装 llvm 编译器。我想知道我该如何解决它。有人说 MacOsX 有运行 emscripten 的问题。但我想知道这是对还是错。
======更新=====
我在 make.py 文件中找到了名为 Apple 的 LLVM 的“cpp”,而不是我自己构建的 LLVM。在 make.py 文件中,
旧代码
Popen(['cpp', '-x', 'c++', '-I../src', '../../root.h'], stdout=open('headers.pre.h', 'w')).communicate()
更改代码
Popen(['clang++', '-x', 'c++', '-I../src', '../../root.h' ], stdout=open('headers.pre.h', 'w')).communicate()
但是即使我更改了make.py,问题仍然存在。错误消息如下。
==========================
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...
我想知道我该如何解决它。