delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/05/17:36:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-Filter: check_local AT alphatech DOT com 4.4(020923:1754) http://digitalanswers.org/
Message-Id: <4.3.2.7.2.20030605143214.03279490@mail.alphatech.com>
X-Sender: alant AT mail DOT alphatech DOT com
Date: Thu, 05 Jun 2003 14:36:10 -0700
To: "Thomas X. Hoban" <thoban AT verbalogic DOT com>, <cygwin AT cygwin DOT com>
From: Alan Thompson <athompson AT alphatech DOT com>
Subject: Re: Linking with JNI Invoke Using Cygwin gcc
In-Reply-To: <DLEPIMCBMLJEPMIPNAEDOEFOCAAA.thoban@verbalogic.com>
Mime-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h55LaRB10197

Hi Tom - There is a quirk when using the JNI Invocation API on Cygwin (non-invocation JNI works as expected).  The solution is documented nicely at the excellent JNI-on-Cygwin webpage:  http://www.inonit.com/cygwin/.  You can also download some sample JNI code, including both invocation- and non-invocation-code at http://www.whitecaps.net/jni/expr.jar.

Alan Thompson


At 04:21 PM 6/5/2003 -0500, Thomas X. Hoban wrote:

>I have written a DLL and a test program that uses the JNI api to invoke a
>JVM.  When I try to link with a test program, I get an error indicating that
>a reference to __imp__JNI_CreateJavaVM AT 12 is undefined.
>
>$ export JAVA_HOME=/cygdrive/c/j2sdk1.4.1_02
>$ g++ -c ­I$JAVA_HOME/include ­I$JAVA_HOME/include/win32 JavaGateway.c++
>$ g++ -I$JAVA_HOME/include ­I$JAVA_HOME/include/win32 ­L$JAVA_HOME/lib \
>-ljvm JavaGateway.o -o testGateway testGateway.c++
>
>The link command above produces these errors:
>
>JavaGateway.o(.text+0x171):JavaGateway.c++: undefined reference to
>`__imp__JNI_CreateJavaVM AT 12'
>JavaGateway.o(.text+0x251):JavaGateway.c++: undefined reference to
>`__imp__JNI_CreateJavaVM AT 12'
>collect2: ld returned 1 exit status
>
>I assume that the jvm.lib file provided with the sdk was compiled with MS
>VC++.  Does the cygwin gcc compiler massage the symbol references
>differently from MS?  Does anyone have a suggestion on how I can make this
>work?
>
>Thanks,
>
>Tom



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019