X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org X-Daemon-Port: 587 Message-ID: <496AC6E9.3090709@sylvan-glade.com> Date: Sun, 11 Jan 2009 20:28:25 -0800 From: rhs DOT cygwin AT sylvan-glade DOT com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.6.0.104 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Questions about missing DLLs and program behvior, and symlinks to DLLs (also, a small setup recommendation) OpenPGP: id=7599038C; url=http://ray.sylvan-glade.com/pgp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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! I haven't been able to find anything about this in the archives. I recently decided to replace my old Cygwin installation with a new, fresh one, so everything should be up-to-date here. [That's my recommendation: perhaps a way to make it easier to install fresh; it was necessary to rename both the old Cywin installation and the location of the downloaded installation packages to keep setup from finding them.] The DLL questions are regarding programs compiled within Cygwin: when a program can't find a DLL, one expects some sort of error message to that effect, and which would indicate the DLL in question. As my demo below shows, programs simply exit silently and unceremoniously when that happens. Second, symlinking to DLLs doesn't enable programs to find them, as is also shown below. The question turned up when I compiled ffmpeg within Cygwin and the DLLs it produced weren't where ffmpeg.exe expected them to be, and it simply exited with no visible evidence of why. Moving the DLLs to where ffmpeg.exe could see them fixed the problem; however, symlinking to them (which is how ffmpeg installs itself) rather than copying them did not work. I am assuming that programs compiled entirely within the Cygwin environment, with Cygwin tools and libraries, should know Cygwin symlinks, and they do, usually, apparently just not when trying to load DLLs. Here's a basic test, compiling and running the same sources in Cygwin and MinGW. Everything is the same in both cases except that after renaming the DLL to hide it from footest.exe, running the Mingw version produces a dialog saying that footest.dll can't be found, while in the Cygwin case, nothing happens at all; the program simply silently aborts. Additionally, symlinking footest.dll to footest-save.dll after the rename doesn't help, as mentioned above. Anybody know anything about this? ============== /* footest.h */ #include #include #include void do_nothing_particularly_spectacular(void); ============= /* Missing DLL test: Cygwin vs. non-Cygwin footest-1.c (Main program) (Aren't you glad that old joke wasn't about a pterodactyl?) */ #include "footest.h" main(int argc, char **argv) { printf("footest: You've gotten as far a main(), anyway.\n"); do_nothing_particularly_spectacular(); printf("footest: You've gotten back from the DLL, but you knew that.\n"); exit(0); } ================= /* Missing DLL test: Cygwin vs. non-Cygwin footest-2.c (DLL source) */ #include "footest.h" void do_nothing_particularly_spectacular(void) { printf("You've found the DLL. Congratulations.\n"); } ============== The action under Cygwin (Some lines here are wrapped by Thunderbird.): $ export PS1="\u@\h (Cygwin) \$ " rsimard AT higgins (Cygwin) $ rm -f footest.exe footest*.dll rsimard AT higgins (Cygwin) $ gcc --version gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. rsimard AT higgins (Cygwin) $ gcc -shared -o footest.dll footest-2.c rsimard AT higgins (Cygwin) $ gcc -o footest.exe footest-1.c footest.dll rsimard AT higgins (Cygwin) $ footest ; echo $? footest: You've gotten as far a main(), anyway. You've found the DLL. Congratulations. footest: You've gotten back from the DLL, but you knew that. 0 rsimard AT higgins (Cygwin) $ mv -i footest.dll footest-save.dll rsimard AT higgins (Cygwin) $ footest ; echo $? 53 rsimard AT higgins (Cygwin) $ ln -s footest-save.dll footest.dll rsimard AT higgins (Cygwin) $ footest ; echo $? 53 rsimard AT higgins (Cygwin) $ # Nothing happened in the last two cases to # indicate that the program failed to do rsimard AT higgins (Cygwin) $ # anything because of a missing DLL. Also, # as you can see, symlinking the renamed DLL # to the original name didn't help. rsimard AT higgins (Cygwin) $ exit exit Thanks for any help, Ray Simard -- 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/