Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <012a01c02033$936effc0$f7c723cb@lifelesswks> From: "Robert Collins" To: Subject: linking against shared libraries Date: Sun, 17 Sep 2000 10:12:23 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.3018.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 X-OriginalArrivalTime: 16 Sep 2000 23:10:56.0727 (UTC) FILETIME=[5E806E70:01C02033] Gary thanks for your tips on libtool... I have it _mostly_ working. There are two issues I've found during my work on glib. (BTW the long delay is becuase this is a 'spare time project' 1. Linking against installed shared libraries without libtool fails however. ld finds the .a file, not the .dll file. example: using testglib.c from the glib 1.2.8 tarball. gcc testglib.c -o testglib.exe -I/usr/local/include -I/use/local/lib/g;lib/include -lglib usr/local/lib is in my ld run path.. GCC correctly finds the library functions., and looks for the _imp_ prefix in front of exported variables (as per the .h file) but can't find the exported variables. ld fails to find 0lglib if libglib.a is renamed, but libglib.la and libglib-1-2-0-0-8.dll are present. running libtool gcc testglib.c -o testglib.exe -I/usr/local/include -I/use/local/lib/g;lib/include /usr/local/lib/libglib.la causes gcc testglib.c -o testglib.exe -I/usr/local/include -I /usr/local/lib/glib/include /usr/local/lib/libglib-1-2-0-0-8.dll -Wl,--rpath -Wl,/usr/local/lib -Wl,--rp ath -Wl,/usr/local/lib To be run, which works correctly. Running the first command, replacing -lglib with /usr/local/lib/libglib-1-2-0-0-8.dll works. Equally renaming the -1-2-0-0-8.dll to libglib.dll works. I suspect this is either a libtool dll naming issue or a ld search order issue. Unfortunately I don't have the spare time to dig into it. 2. I'm having problems with dlsym/dlopen et al. Can anyone point me to some references on using dlsym/dlopen under cygwin with libtool generated dll's? Ok so maybe a reference guide is a bit hopeful. I'm happy to keep reading the various disparate bits of doco floating around but narrowing the search would help. Specifically are there any quirks with dlopen/dlsym on cygwin (other than the library being a .dll not a .so?) The call that is stumping me at the moment is dlsym (handle to self, "g_module_close"). nm shows a _g_module_close and a _imp__g_module_close in the test .exe The purpose is to retrieve the symbol address, of a dynamically bound function... FWIW I'm working on getting libgmodule working, I've successfully built the whole gnome-base and core-apps tarballs. (without dynamic libraries... and thus libgmodule is needed) Once gmodule is working there should be full (-sound) gnome capabilities for an NT based system (with Cygwin/XFree86). -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com