From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14328 invoked by alias); 4 Dec 2007 15:59:45 -0000 Received: (qmail 14319 invoked by uid 22791); 4 Dec 2007 15:59:44 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 04 Dec 2007 15:59:38 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id lB4FxawV017929 for ; Tue, 4 Dec 2007 10:59:36 -0500 Received: from zebedee.littlepinkcloud.COM (vpn-14-8.rdu.redhat.com [10.11.14.8]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id lB4FxZWf025081; Tue, 4 Dec 2007 10:59:36 -0500 Received: from littlepinkcloud.COM (localhost.localdomain [127.0.0.1]) by zebedee.littlepinkcloud.COM (8.13.8/8.13.5) with ESMTP id lB4FxXwY028408; Tue, 4 Dec 2007 15:59:34 GMT Received: (from aph@localhost) by littlepinkcloud.COM (8.13.8/8.13.5/Submit) id lB4FxWF7028404; Tue, 4 Dec 2007 15:59:32 GMT MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18261.31076.962649.532047@zebedee.pink> Date: Tue, 04 Dec 2007 15:59:00 -0000 From: Andrew Haley To: Joe Hoffert Cc: gcc-help@gcc.gnu.org Subject: Re: GCJ .jar to .so with native method In-Reply-To: <1196782972.3362.22.camel@sirion.dre.vanderbilt.edu> References: <1196774413.3986.18.camel@sirion.dre.vanderbilt.edu> <18261.21978.841368.32225@zebedee.pink> <1196777200.3362.11.camel@sirion.dre.vanderbilt.edu> <18261.28465.895232.916931@zebedee.pink> <1196782972.3362.22.camel@sirion.dre.vanderbilt.edu> X-Mailer: VM 7.19 under Emacs 22.0.93.1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00085.txt.bz2 Joe Hoffert writes: > Hi, Andrew. > > On Tue, 2007-12-04 at 15:16 +0000, Andrew Haley wrote: > > OK. I've attached a zip file with everything that should be needed. The > gcj-commands file simply contains the gcj and gcjh commands I used to > generate the .so library and the .h header files. Works for me: zorro:tmp $ gcjh -classpath ./ricochet.jar multishot.examples.RicochetApp zorro:tmp $ gcj -shared -fPIC -Wl,-Bsymbolic ./ricochet.jar -o libricochet.so zorro:tmp $ gcj RicochetAppMain.cpp -L. -lricochet -fPIC -lstdc++ cc1plus: warning: command line option "-fbootclasspath=./:/usr/share/java/libgcj-4.1.2.jar" is valid for Java but not for C++ zorro:tmp $ LD_LIBRARY_PATH=. ./a.out Usage: RicochetApp GMS_id FDS_id startPortNumber [propertyString] You really need to call JvCreateJavaVM() first. If this doesn't give you the same results, the problem is likely to be that you need a new version of gcj. Andrew. -- Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK Registered in England and Wales No. 3798903