Problem was fixed. argv - must be NULL terminated :-)

On Tue, Jun 21, 2011 at 9:39 AM, SerP <[email protected]> wrote:

> Hello! I have been developing a framwork on ocaml for mobile platforms. The
> main idea is to create a universal 2D framework for game development. I
> started with porting "sparrow" http://www.sparrow-framework.org framework
> from objc to ocaml.
>
> Repository https://github.com/serp256/Lightning. The repository does not
> include the entire project yet, I will commit the rest as soon as
> possible. I have successfully launched the project on iOS, and SDL version
> on macosx and linux.
>
> Now I'm trying to port it on android, and after that there will be an
> official release of the framework with the first game on it.
>
> However, I encountered an unclear issue.
>
> When I tried to launch it on android, I received an errorr sigsegv which
> always occurs on ocaml_startup in case objects are used in the code.
>
> To compile ocaml for android I'm using the patch from "
> http://www.itpl.co.jp/ocaml-nagoya/index.php?ocaml-android";.
>
> I don't know very well arm assembler, but I'm trying to solve this problem.
> Can someone from the maillist help me
>
>
> === test_stub.c ===
> #include <jni.h>
> #include <android/log.h>
>
>
> jint JNI_OnLoad(JavaVM* vm, void* reserved) {
>   __android_log_write(ANDROID_LOG_DEBUG,"LIGHTNING","JNI_OnLoad from
> stub");
>   char *argv[] = {"android"};
>   caml_startup(argv);
>   __android_log_write(ANDROID_LOG_DEBUG,"LIGHTNING","caml initialized");
>   return JNI_VERSION_1_6; // Check this
> }
> =======
> ==== test.ml ===
> let a = 1
> ====
>
> ocamlfind -toolchain android ocamlopt -c test_stub.c
> ocamlfind -toolchain android ocamlopt -c test.ml
> ocamlfind -toolchain android ocamlopt -output-obj -o libtest.so test.cmx
> test_stub.o
> cp libtest.so ../libs/armeabi/
> --- Here as usual compile android project, and it's ok!
>
> When I write in test.ml
> ====
> let a _ = object method render () = () end
>
> It's SIGSEGV on ocaml_startup. It's magic for me!
>
>

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to