Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[cpp] #include <hx/HxcppMain.h #4199
I am trying to create a cross-platform API and library, and therefore I do not require my library to be executable, i.e. no
$ haxe -cp src -java java_out example.expath.file.FileModule
I also want to produce a compilation to C++, using the equivalent command line for the cpp backend:
$ haxe -cp src -cpp cpp_out example.expath.file.FileModule
I get the following compilation error:
g++ -Iinclude -DHX_DECLARE_MAIN -c -fvisibility=hidden -stdlib=libstdc++ -O2 -I/usr/lib/haxelib/hxcpp/3,2,81/include -DHX_MACOS -m64 -Wno-parentheses -Wno-unused-value -Wno-format-extra-args -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=321 -x c++ -frtti -Wno-invalid-offsetof ./src/__main__.cpp -oobj/darwin64/501f6158___main__.o Error: ./src/__main__.cpp:10:25: error: expected "FILENAME" or <FILENAME> #include <hx/HxcppMain.h ^ 1 error generated. Error: Build failed
Is it possible to generate a dynamically linked library using the CPP backend? I rather expected this to be the default if I did not pass
The issue with the include has been fixed.
@hughsando How do I get access to the fix?
I am not a C++ developer in any sense, but I am trying to create a small module that can be used from either Java or C++. I do not really also want to maintain anything additional outside of Haxe, i.e. another well-defined-API. Is it not possible to create a dynamic library + include files that I can distribute to C++ developers in Haxe?