Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 X-Spam-Filter: check_local AT alphatech DOT com 4.4(020923:1754) http://digitalanswers.org/ Message-Id: <4.3.2.7.2.20030801202215.026caf70@mail.alphatech.com> X-Sender: alant AT mail DOT alphatech DOT com Date: Fri, 01 Aug 2003 20:29:30 -0700 To: cygwin AT cygwin DOT com From: Alan Thompson Subject: Re: loading DLLs created with Cygwin into Sun JDK In-Reply-To: <3F2B292B.3020600@santafe.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Ok, if you check out this example: http://www.whitecaps.net/jni/expr.jar you'll see that there it doesn't use -mno-cygwin. Here is the g++ task from the ant build script: ..... Works for me! =============================================================== > ant Buildfile: build.xml ............. ccComp: [mkdir] Created dir: C:\work\test\expr\jni\hello\ctmp [copy] Copying 2 files to C:\work\test\expr\jni\hello\ctmp [echo] Compiler Name: g++ [echo] Compiler Version: [exec] g++ (GCC) 3.2 20020927 (prerelease) [exec] Copyright (C) 2002 Free Software Foundation, Inc. [exec] This is free software; see the source for copying conditions. There is NO [exec] warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [echo] Compiling for Cygwin... [echo] Linking for Cygwin... go: [java] loading library ......... [java] answer[ 0 ] = 'Hello World from C!' [java] answer[ 1 ] = 'the new C string value' [java] answer[ 2 ] = 'initial value from java' BUILD SUCCESSFUL Total time: 17 seconds > =============================================================== At 08:59 PM 8/1/2003 -0600, Marcus G. Daniels wrote: >Again, "those techniques" specify use of -mno-cygwin, which worked fine for me in my posted example. The crash happens as the DLL is loaded, not when methods are called. > >Have you actually tried _not_ using -mno-cygwin? > >Also, using 'javah' or not to generate the headers (and making sure JNIEXPORT and >JNICALL are in the header and implementation declarations, and using >and using -Wl,--add-stdcall-alias makes no difference. For this simple test case, you need to have JNIEXPORT/JNICALL and the -Wl,--add-stdcall-alias, or neither to get the test case to work. -- 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/