How to alter cpp compilation?


#1

As I’m new in Haxe, I haxe problem with its somewhat more sophisticated features. Now I’m trying to use haxebullet library. But there is an error while building:

Error: ./src/Main.cpp:6:10: fatal error: BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h: Nie ma takiego pliku ani katalogu
#include “BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

There is a mention in haxebullet readme:

In order to get C++ build to work you need to add ‘haxebullet/cpp/bullet’ directory into your build process so compiler is able to find bullet sources.

But it’s very enigmatic. I found this topic and try to follow instructions, but without any difference. I can’t even debug my macro, because echo tag don’t “echos” anything.
@:buildXml("
<xml>
<echo value='${haxelib:haxebullet}'/>
<compilerflag value='-I${haxelib:haxebullet}/cpp/bullet'/>
</xml>
")

It’s probably matter of reading documentation carefully, but I’m already tired and overhelmed. Please give me some prompt…


#2

Hmm, that’s a strange way to say it, “into your build process”

Perhaps they mean a class path, like <source path="path/to/haxebullet/cpp/bullet" if="cpp" />?

If the library does not have an “include.xml”, this could be added to the HaxeBullet lib root, with additional tags like: <source path="cpp/bullet" if="cpp" />

That would be resolved relative to the Haxelib, and resolved automatically when used in a Lime/OpenFL project.

Maybe he means something else, but I think there’s a way to do fancy Haxe C++ stuff with includes, so long as the C++ source files are included directly as a Haxe class path