Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3BEFCA9B.6000904@netcom.es> Date: Mon, 12 Nov 2001 13:11:55 +0000 From: Ignasi Villagrasa Organization: gri User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; es-ES; rv:0.9.2) Gecko/20010726 Netscape6/6.1 X-Accept-Language: es-es MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Calling JVM from cygwin Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I'd like to call JVM from C native call using Cygnus compiler. I work in W2000 enviroment using GCC Cygnus compiler. I followed JNI instructions. I read in Java forums there was a change in JDK, and instead of attaching javai.dll, jvm.dll had to be attached. Then I made a test using invoke.c example from JDK. I built following .bat file: gcc -c invoke.c -Id:\jdk1.3.1\include -Id:\jdk1.3.1\include\win32 DLLTOOL --dllname jvm.dll --def libjvm.def --output-lib d:\jdk1.3.1\jre\bin\classic\libjvm.a c++ -o invoke.exe invoke.o -Ld:\jdk1.3.1\jre\bin\classic -ljvm with libjvm.def : EXPORTS _imp__JNI_GetDefaultJavaVMInitArgs AT 4 _imp__JNI_CreateJavaVM AT 12 All seems to work fine, and invoke.exe is generated. But when trying to run it, I get a windows message telling me : invoke.exe doesn't find the entry point to _imp__JNI_CreateJavaVM AT 12 in jvm.dll. What am I going wrong ? Any calling convention issue ? I have seen several messages about JNI linking, and tried some changes in .def calls with no results. Is there anyone having the same problem ? Thanks in advance. Ignasi Villagrasa. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/