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.20030311170553.0317bac8@mail.alphatech.com> X-Sender: alant AT mail DOT alphatech DOT com Date: Tue, 11 Mar 2003 17:12:46 -0800 To: cygwin AT cygwin DOT com From: Alan Thompson Subject: Re: Standard out writes fail after cygwin generated dll loaded In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h2C1CuV15762 I have not experienced this problem. I am using Cygwin to build a JNI .dll file, and regularly use both the cerr output stream from the c++ side and the System.err.println() output function from the java side. Note that I am always running from a Cygwin window. If you have not seen it, you should try visiting the excellend Cygwin/JNI website at: http://www.inonit.com/cygwin/ Note also that you don't need to use the -mno-cygwin hack (perhaps this is related to your problems?). Here is a part of my ant build script (I use the normal Cygwin g++ for builds). ..... ....... Alan Thompson At 12:18 PM 3/7/2003 +0100, José Lorenzo Mon wrote: >Hi Luis and All, > >>When trying to run through the JNI native C code compiled in a DLL >>using Cygwin, I found that standard Java output stops to work as >>soon as the DLL is loaded. However, if the same code is compiled >>without Cygwing (-mno-cygwin) the Java output works OK after and >>before loading the DLL. > >I am having same problem. My tests more in detail: > >- When running the Java VM *from a cygwin shell*, the stdout channel >works OK before and after loading the DLL generated with the cygwin >gcc. However, the stderr stops working after loading the DLL. >After loading the DLL and using the stdout and stderr >channels by the native C function, the Java program is only able to use >the stdout channel. > >- When running the Java VM *from a windows shell*, both the stdout and >stderr channels stop working after loading the DLL. > >- When compiling the dll *without* cygwin support (with the >"-mno-cygwin" flag), both channels work ok in both shells. > >- The version employed of "jni.h" does not seem to affect to the >results. I have tried both versions, the one comming with cygwin and >the version provided with the JDK distribution (defining by >myself __int64). > >- The version of the JDK (1.3 or 1.4) does not seem to affect to the >results. > >- I have tried with different combination of flags for the gcc compiler >and they do not seem to affect to the results. > > >Does anyone know why this is happening or a possible solution? > >Thanks in advance, > > Jose > > > >_________________________________________________________________ >Help STOP SPAM with the new MSN 8 and get 2 months FREE* >http://join.msn.com/?page=features/junkmail > > >-- >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/ > -- 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/