X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: Yes, hits=5.0 required=5.0 tests=AWL,BAYES_00,BOTNET,TW_YG X-Spam-Check-By: sourceware.org Date: Tue, 10 Apr 2012 15:15:39 -0700 (PDT) From: Richard Troy To: Subject: Some context is being stripped and I don't know how to create it to avoid "error while loading shared libraries: ?: cannot open shared object file: No such file or directory" problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes 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 Hello All, some oh, ten years ago or so I ran into this problem and thought I had it licked wherein I'm launching Cygwin's bash utility (and from it another program compiled under Cygwin) from Java. However, while the same code works on every other version of Windows I can remember trying, it seems to have returned for Windows 7. Either that, or I've forgotten some small configuration fix! I've searched the archives and found nothing pertinent so I entered a question about this on Stackoverflow - could save some writing here to just reference that: http://stackoverflow.com/questions/10092730/launching-cygwin-built-executable-from-java-on-windows-7-fails-with-error-while In short, a Gnu C program compiled under Cygwin wakes up, checks security and configuration information, then calls Java. Later, under certain conditions, the Java program wants to instantiate a program similar to itself, so it calls the OS-level tools to launch the same C program from Java, and the new instance of the C program then calls the same or modestly different Java program. The error occurs when the first (oldest) Java program attempts to launch the (second) C program. The call is something like this: cmd.exe /C C:/cygwin/bin/bash -c '/cygdrive/c/opt/ST/v3.3/bin/ST.exe' The reason for calling cmd.exe (on some versions 'command.exe') is due to inconsistencies in behavior if one just calls bash or other executable programs as this is a general purpose interface. (This was developed more than a decade ago and needs to run everywhere - if there's a better way, I'm open to it, but this has worked well for a long time.) It's worth mentioning that there is a test program that confirms the Java call to the OS is working correctly by launching some basic level Cygwin program. It reports success at calling programs to be run under bash. (It could be the test is insufficient / flawed!) Both the Windows PATH and every place I can find to set the "linux" PATH have C:\cygwin\bin or equivalent. I recall that a LONG time ago, I'd copy the cygwin1.dll to various places to cure this type of problem, but I don't think I've done that in a long time (or don't recall doing it!) - doing so now (making a copy in C:/Windows/system32/ for example) didn't help. I'm sure it is no surprise to anyone that everything works fine when it's NOT being launched from Java... But it seems odd to me that I have an old version of XP running with this same setup and the calls from Java work fine! I doubt very much this has anything to do with the Cygwin version, but I'll provide whatever data anyone asks for. However, some things cygcheck reports that caught my eye are to be found below. One notable thing is apparent "orphaned Cygwin installations" - but I don't recall ever making true installations in the locations claimed! (Maybe cygwin1.dll makes these from wherever it's used?) Thank you for any and all help. Regards, Richard ______________________________________________________________________ Excerpts from cygcheck: Windows 7 Professional N Ver 6.1 Build 7600 Running under WOW64 on AMD64 Cygwin installations found in the registry: System: Key: c5e39b7a9d22bafb Path: C:\cygwin System: Key: 715c149bf086df04 Path: C:\opt\ScienceTools\v3.3 (ORPHANED) System: Key: a8fb4064ab2b92ac Path: C:\windows (ORPHANED) Cygwin DLL version info: DLL version: 1.7.6 DLL epoch: 19 DLL old termios: 5 DLL malloc env: 28 Cygwin conv: 181 API major: 0 API minor: 230 Shared data: 5 DLL identifier: cygwin1 Mount registry: 3 Cygwin registry name: Cygwin Program options name: Program Options Installations name: Installations Cygdrive default prefix: Build date: Shared id: cygwin1S5 Warning: There are multiple cygwin1.dlls on your path (YES, I did that trying to cure this problem!) -- Richard -- 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