From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA32420; Fri, 5 Sep 2003 21:09:36 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA25174 for ; Fri, 5 Sep 2003 21:09:35 +0200 (MET DST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h85J9Yf00460 for ; Fri, 5 Sep 2003 21:09:34 +0200 (MET DST) Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19vLy6-00056m-00 for ; Fri, 05 Sep 2003 21:10:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19vLg2-0004t4-00 for ; Fri, 05 Sep 2003 20:51:22 +0200 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 19vLfa-0003pP-00 for ; Fri, 05 Sep 2003 20:50:54 +0200 From: Gregoire Henry Subject: [Caml-list] Re: camljava inside a toplvel ? Date: Fri, 05 Sep 2003 20:51:01 +0200 Message-ID: References: <71A291D8E360AF4EA6FFFAF9CAD136CA04ACFE@fr-mailbox2> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030902 Thunderbird/0.2 X-Accept-Language: en-us, en In-Reply-To: <71A291D8E360AF4EA6FFFAF9CAD136CA04ACFE@fr-mailbox2> X-Loop: caml-list@inria.fr X-Spam: no; 0.00; gregoire:01 gregoire:01 ocamlmktop:01 callbacks:01 ocamlc:01 ocamlc:01 classpath:01 camlprog:01 mli:01 ocamlmktop:01 -verbose:01 -linkall:01 nologo:01 libcamlrun:01 advapi:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I've got the same within Linux. It's just a "typo" in 'jnistubs.c' file : line 389 the function should be called : camljava_CallStaticCamlintMethod instead of : camljava_CallStaticCamlIntMethod with a lower 'i' in Camlint Then : $ ocamlmktop -o ocamljni -I +camljava jni.cma $ ./ocamljni -I +camljava should work. regards, Gregoire Henry EL CHAAR RABIH wrote: > Hello, > i'm working with camljava (Xavier Leroy) to call java classes via caml. > > It uses jni and c-caml callbacks to achieve this. > > A library jni.cma, which permits caml to achieve this. > In the test package, we have a jnitest.ml, and 2 java classes. > > The creation of an executable via ocamlc works fine > > ocamlc -I +camljava jni.cma jnitest.ml > > launching the executable > > CLASSPATH="." ./camlprog works fine. > > I'm trying to execute directly the jnitest.ml via the ocaml toplevel. > > I've tried doing the following > ocaml -I +camljava jni.cma jnitest.ml but it doesn't work, and i have an > error message that some external functions are not here > The external function `camljava_AllocObject' is not available > > If i understand the problem, since these functions are declared as external, > i've tried to build a new toplevel, ocamljni which supports them. > Unfortunately, things don't seem to be that easy. > > To achieve jni.cma, we have jni.ml, jni.mli and jnistubs.c > > jni.ml is compiled into a jni.cmo > jnistubs.c is compiled into jnistubs.obj > > jnistubs.obj is put into library libcamljni.lib > > jni.cmo and libcamljni.lib enter in the creation of jni.cma. > > I've tried following the same approach, using libcamljni.lib and jni.cmo for > creating the ocamljni toplevel. > when i'm trying to do this > ocamlmktop -verbose -o ocamljni -linkall -custom jni.cmo -cclib -lcamljni > -cclib D:/APPLI/j2sdk1.4.1_01/lib/jvm.lib i'm having the following exception > in the linking process (CL) > > + cl /nologo /MT /Fe"mlfijni.exe" -I"D:\APPLI\MLFi\lib" > c:\TEMP\camlprimcd1cd1.c "libcamljni.lib" "D:/APPLI/j2sdk1.4.1_0 > 1/lib/jvm.lib" "D:\APPLI\MLFi\lib\libcamlrun.lib" advapi32.lib > camlprimcd1cd1.c > camlprimcd1cd1.obj : error LNK2001: unresolved external symbol > _camljava_CallStaticCamlintMethod > mlfijni.exe : fatal error LNK1120: 1 unresolved externals > Error while building custom runtime system > > The function camljava_CallStaticCamlintMethod is defined inside jnistubs.c, > and should be therefore present inside libcamljni.lib. > > Am i missing something ?? > > Thanks in advance for your help. > > > > ************************************************************************* > Ce message et toutes les pieces jointes (ci-apres le "message") sont > confidentiels et etablis a l'intention exclusive de ses destinataires. > Toute utilisation ou diffusion non autorisee est interdite. > Tout message electronique est susceptible d'alteration. > SG Asset Management et ses filiales declinent toute responsabilite au titre > de ce message s'il a ete altere, deforme ou falsifie. > > Découvrez l'offre et les services de SG Asset Management sur le site > www.sgam.fr > > ******** > > This message and any attachments (the "message") are confidential and > intended solely for the addressees. > Any unauthorised use or dissemination is prohibited. > E-mails are susceptible to alteration. > Neither SG Asset Management nor any of its subsidiaries or affiliates shall > be liable for the message if altered, changed or falsified. > > ************************************************************************* > > > > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners