Re: How to cross-compile a Nim executable for Android

2018-05-16 Thread yglukhov
1. No idea, but maybe a more complete example that compiles and runs and shows the problem would help. Bonus points for reproducing with localhost JVM, and not android 2. Yeah, that's how asyncdispatch works. You have to run the loop to make async things happen. In your case you run it by

Re: How to cross-compile a Nim executable for Android

2018-05-16 Thread alexsad
@yglukhov, thanks, it was helpful. For most cases the functionality of java interface implementation works. But in some cases I get error at runtime: java_vm_ext.cc:504] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NullPointerException: Expected

Re: How to cross-compile a Nim executable for Android

2018-03-22 Thread yglukhov
@alexsad, take a look at [https://github.com/yglukhov/android](https://github.com/yglukhov/android)

Re: How to cross-compile a Nim executable for Android

2018-03-22 Thread alexsad
thanks a lot mashingan! It is working! Now I am going to implement JNI to call java classes(some SDK has been already developed in Java) for manage android application.

Re: How to cross-compile a Nim executable for Android

2018-03-21 Thread mashingan
you forgot to link libm, add option `-lm` at very end.

Re: How to cross-compile a Nim executable for Android

2018-03-21 Thread alexsad
Hi finelly is works! I tried the way suggested Tetralux via make_standalone_toolchain.py and then clang. Simple echo works, but I tried simple pow from math and clang doesn't compile it: import math var a = pow(5.09, 2.33) clang -I

Re: How to cross-compile a Nim executable for Android

2018-03-20 Thread mashingan
Hmm, I'm not sure, all I can say is the cross compiler cannot find the sysroot This the exact command line I did and it success \nimcache>arm-linux-androideabi-gcc -I d:/installer/nim/lib hello_android.c stdlib_system.c -o hello

Re: How to cross-compile a Nim executable for Android

2018-03-20 Thread alexsad
Hi mashingan, I tried cross-compile the same hello.nim from linux and **got the same errors exactly like in windows**. what I did: 1. Cloned nim-lang branch master from github and compled it. 2. Downloaded android ndk 3. Defined all needed paths in PATH 4. Compile hello.nim: nim c

Re: How to cross-compile a Nim executable for Android

2018-03-20 Thread alexsad
> cd C:\Users\uname\Documents\nimapps\jnijava\ > set PATH=%PATH%;C:\Users\uname\Documents\apps\android-ndk-r16b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin > nim c --cpu:arm --os:android --compileOnly hello.nim > cd nimcache >

Re: How to cross-compile a Nim executable for Android

2018-03-20 Thread mashingan
Could you give the command-line you typed? For example, what I did was like this arm-linux-androideabi-gcc.exe -I "C:/Nim/lib" hello.c stdlib_system.c -o hello --sysroot="C:/Users/uname/Documents/apps/android-ndk-r16b/platforms/android-19/arch-arm"

Re: How to cross-compile a Nim executable for Android

2018-03-20 Thread alexsad
Hi mashingan, thank you for suggestion and I tried all this /," and // possibilities but errors are the same. any other suggestions? maybe I have not prepared some things...

Re: How to cross-compile a Nim executable for Android

2018-03-19 Thread mashingan
Have you tried `/` in path string instead of `\` as path separator ? Also you can try adding `"`. Very likely because you were using `\` so gcc couldn't find the correct path. See my example above all using `/`.

Re: How to cross-compile a Nim executable for Android

2018-03-19 Thread alexsad
Hi, I tried last example. Unfortunately doesn't work for me. C:\Users\uname\Documents\nimapps\jnijava\nimcache>arm-linux-androideabi-gcc.exe -I C:\Nim\lib hello.c stdlib_system.c -o hello --sysroot=C:\Users\uname\Documents\apps\android-ndk-r16b\platforms\android-19\arch-arm

Re: How to cross-compile a Nim executable for Android

2018-03-09 Thread mashingan
Thank you, I did different approach. I followed from this stackoverflow thread about cross compiling