Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3C3B5B3A.8070808@ece.gatech.edu>
Date: Tue, 08 Jan 2002 15:48:58 -0500
From: Charles Wilson <cwilson@ece.gatech.edu>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2
X-Accept-Language: en-us
MIME-Version: 1.0
To: "David P. Caldwell" <inonit@inonit.com>
CC: cygwin@cygwin.com
Subject: Re: Cygwin/Java-JNI tutorial available (plus gcc question)
References: <JIEPJODHFFPGJDGMCPBEOEFACHAA.inonit@inonit.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

David P. Caldwell wrote:

> I was having trouble figuring out how to build Java/JNI programs with
> Cygwin.  There were a number of threads in the mailing list about it, and
> some were helpful, but it still took a great deal of slogging.
> 
> After I got it working, I put a tutorial on the web
> (http://www.inonit.com/cygwin/) on how to do it.
> 
> If you are an expert on these matters (and don't feel like reading the
> tutorial), one question came up.  I was unable to link my examples into DLLs
> using gcc.  (Or, more properly, I was able to link it into a DLL, but the
> Java virtual machine would invariably complain that the function it was
> looking for did not exist.)  I ended up using LCC-Win32.  There's some more
> information about what occurred (and my cygcheck -s output) at
> http://www.inonit.com/cygwin/jni/helloWorld/c.html.


I don't have Java installed on this machine so I can't test this myself. 
  But, try the following additional options to gcc:

-Wl,--export-all-symbols

If that doesn't work, then try again with the above option, but in addition:

-Wl,--add-stdcall-alias

Does any of that help?

--Chuck



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

