Problem with sample project ( Debian Linux)
Closed this issue · 4 comments
I have some problems to run the sample project ( Haxe 4.1.1):
1) Downloading Ammer from instruction give a error:
haxelib git ammer git@github.com:Aurel300/ammer.git
Installing ammer from git@github.com:Aurel300/ammer.git
Error: Could not clone Git repository.
The following command works :
haxelib git ammer https://github.com/Aurel300/ammer.git
Installing ammer from https://github.com/Aurel300/ammer.git
Library ammer current version is now git
2) Compile to cpp give the error
Error: In file included from ./src/ammer/externs/AmmerExtern_adder_0.cpp:9:
include/../ammer/ammer_adder.cpp.c: In function ‘unsigned char* w_load_file(const char*, size_t*)’:
include/../ammer/ammer_adder.cpp.c:14:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
return (unsigned char * )load_file(arg_0, arg_1);
^~~~~
In file included from include/../ammer/ammer_adder.cpp.c:1,
from include/ammer/externs/AmmerExtern_adder_0.h:11,
from ./src/ammer/externs/AmmerExtern_adder_0.cpp:5:
/home/ronnis/ammer/native/tmp.adder.h:14:43: note: initializing argument 1 of ‘unsigned char* load_file(char*, size_t*)’
LIB_EXPORT unsigned char *load_file(char *filename, size_t *loaded);
~~~~~~^~~~~~~~
Error: Build failed
3) Compile to eval give
haxe build-eval.hxml
Adder.hx:5: character 1 : required define: ammer.eval.haxeDir
Thanks for the report!
1: This is a problem with your git setup, unrelated to ammer. Do you have SSH keys set up? Can you normally git clone
with SSH URLs from GitHub?
2: The sample was indeed broken by the recent commit 682bc5a, it is now fixed.
3: So, eval is not working at the moment (#20). The problem is that I don't really know how to incorporate ammer builds into the new Haxe build system that uses dune. It seems like it would require pasting the code into the compiler repo and triggering a rebuild.
Thank you for the fix.
About SSHit was my mistake indeed.
Everything works now.
About ammer I was wondering how to use it for mobile builds. At example to support WebRTC in Haxe ( for mobile and web) with Janus WebRTC server ( which have JS and C++ client ) .
I also tried to compile adder example to Android ( using Lime toolchains ) . At the moment there is not so much choice to compile to Android ( if you don't want to create the toolchains) , but I wasn't sure how to include libadder.so , so get the error ld: error: cannot find -ladder
I think linking C++ library for Android and iOS with ammer and js externs from Haxe will cover all platforms ( desktop, mobile, web).
Thank you again.
Glad to see it works.
I have not tested Android or iOS builds yet, although soonish (end of June) I will probably try this as well. There is no reason it cannot work, but some tooling issues may need to be sorted out.
For your specific project – did you also compile the actual native library (the one that contains the C function add_numbers
etc) for Android? This is not the responsibility of ammer, at least not at the moment, so you need to invoke the Android NDK compilers manually to produce a shared object file that works with the correct architecture. The actual invocation should be more or less the same as the one in the Linux Makefile
but using a different gcc
command.
Yes, you are right. I compiled to Linux using Linux Makefile , but that was for wrong architecture and not produce a shared object file for Android.
It'll be cool to see support for iOS and Android in ammer.