I’m currently evaluating Haxe for a new hobby project I’d like to start which for a start should be able to run on various embedded linux machines (arm, x86, x64, …) and I’d like to reuse some library code later on for an android app.
I’ve found the HelloWorld.hx sample and compiled it in a subdirectory using
haxe -main HelloWorld -cpp cpp
I then copied the binary to another (embedded instead of desktop) x64 linux machine where it doesn’t print the HelloWorld but instead gives this error:
./HelloWorld: /lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./HelloWorld)
So I’ve looked for a way to get a static compile, and I found
haxe -main HelloWorld -cpp cpp -D static_link
But that only gave me a HelloWorld.a library file and not an executable.
UPDATE: So I found this question today:
which has 1 answer that ends with:
If you want, try experimenting with changing the HXCPP toolchain for Linux to enable a static libstdc++ library if=“static_link” and share the results here or on the Haxe community forum.
So if I understand that correctly it is not possible at the moment to compile a binary that will run on a different system with a different version of glibc++ installed, without some extra work on the way haxe compiles a binary that probably requires some deeper insight than of a newbie evaluating haxe. Correct?