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

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
Date: Mon, 17 Feb 2003 14:24:37 -0500
Message-Id: <200302171424.AA2621680@iconnextion.com>
Mime-Version: 1.0
From: "Jim Marshall" <jim AT iconnextion DOT com>
Reply-To: <jim AT iconnextion DOT com>
To: <cygwin AT cygwin DOT com>
Subject: Cygwin GCC & JNI??

Sorry if this is a dup, I hit send on the previous message too soon...

Hello,
 First, I'm fairly new to gcc so if this isn't the right list
plese direct me to the correct one.

 I have some code which compiles a shared object, it compiles fine
on Red Hat 8 and even on Solaris for Intel. I'm now attempting to
compile this same code of Windows XP using Cygwin.  This shared
object calls functions in the java VM (jvm.dll on windows). When I
compile on Windows I get an error stating that it can't find the
function JNI_GetCreatedVms function. I'm sure that has to do with
the way the jvm.dll is compiled n windows and the calling
convention, but I can;t figure it out. I've looked for the past
two days and havn't found that much. can anyone lend me a helping
hand? I have search teh web and found several sources of info
(inonit.com etc..) but none have solved my problem.

I'm using g++ 3.2 20020927 (prerelease) which came with
cygwin (I downloaded cygwin last week).  Here is the command I am
passing to g++ ad the output:

g++ -Wl,--add-stdcall-alias -mno-cygwin -I. -I../common
-Ic:/cygwin/usr/java/include -Ic:/cygwin/usr/java/include/win32
-shared -o Tool.dll Tool.cpp  -Lc:/cygwin/usr/java/lib -ljvm 

/cygdrive/c/temp/ccDembDG.o(.text+0x1dac):Tool.cpp: undefined
reference to `_
imp__JNI_GetCreatedJavaVMs AT 12'
/cygdrive/c/temp/ccDembDG.o(.text+0x1e23):Tool.cpp: undefined
reference to `_
imp__JNI_GetCreatedJavaVMs AT 12'
make: *** [NPITool.dll] Error 1

I needthe DLL to compile with no dependency on cygwin, hence the
-mno-cygwin. The -Wl,--add-stdcall-alias is something I just added
after reading information at
http://www.inonit.com/cygwin/jni/invocationApi/execute.html before
it was just -Wall.

Thank you
-Jim 
 




 
                   

--
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/

- Raw text -


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