X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=2.4 required=5.0 tests=AWL,BAYES_00,BOTNET X-Spam-Check-By: sourceware.org Message-id: <4B7DAEF1.2090202@cygwin.com> Date: Thu, 18 Feb 2010 16:19:45 -0500 From: "Larry Hall (Cygwin)" Reply-to: cygwin AT cygwin DOT com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090320 Remi/2.0.0.21-1.fc8.remi Lightning/0.9 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0 MIME-version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: "undefined reference to `_JNI_CreateJavaVM'" References: <20100218104310 DOT GB3156 AT mimosa DOT garydjones DOT name> <4B7D6F11 DOT 3070204 AT cygwin DOT com> <20100218205056 DOT GA2324 AT mimosa DOT garydjones DOT name> In-reply-to: <20100218205056.GA2324@mimosa.garydjones.name> Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 02/18/2010 03:50 PM, Gary wrote: > On Thu, Feb 18, 2010 at 11:47:13AM -0500, Larry Hall (Cygwin) wrote: >> On 02/18/2010 05:43 AM, Gary wrote: >>> I've basically followed along with what is written at >>> http://www.inonit.com/cygwin/jni/invocationApi/ (built an import >>> library, passed ld the "-L. -ljvm" parameters, and so on). One difference >>> is that gcc no longer supports -mno-cygwin, but I'm not convinced that >>> is the cause. >> >> Since the above site isn't cygwin.com, this list really can't support the >> process they've outlined. > > I'm not asking you to. My point is that if you're having trouble with a procedure/instructions you found on another site, your best bet is to query the authors first. >> if you really need '-mno-cygwin', then you're not building for >> Cygwin, > > With or without is irrelevant to me. Since I am using Cygwin tools I am > perfectly happy to not have the '-mno-cygwin'. OK, if you prefer Cygwin and the DLL that comes with it (licensing and all), then you can certainly experiment. You need to be conscious of differences between POSIX and Windows though. However, if you are, you want to build as if you're in a POSIX environment (because you are). You should avoid using the "win32" includes. Your undefined reference is likely coming about because of a mixture of calling conventions though. You need to look at the calling convention that the JNI stuff uses. Compiling with Cygwin for Cygwin is going to get you the C calling convention, which is what you see for the undefined reference above. My guess is the Windows JNI interface you're linking against uses stdcall. If so, you'd need your declarations of the functions you're going to call there to match. This would be another reason to not use Cygwin's gcc since doing so would make more work for you. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _____________________________________________________________________ A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple