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 From: "Jeff Lu" To: "Charles S. Wilson" Cc: Subject: RE: Question Date: Tue, 24 Oct 2000 11:04:15 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 In-reply-to: <39F4D7B9.EA33204A@ece.gatech.edu> Importance: Normal I compiled it with CFLAGS=-DGDBM_STATIC such as this gcc -o /home/jeff/getdata.cgi getdata.c -lgdbm utils.c -DGDBM_STATIC This takes care of the rename problem but am still getting dbm_open, dbm_fetch etc. as undefined reference I've even tried to explicitly link it to /usr/lib/libgdbm.a but that didn't help -----Original Message----- From: Charles S. Wilson [mailto:cwilson AT ece DOT gatech DOT edu] Sent: Monday, October 23, 2000 8:29 PM To: Jeff Lu Cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Question Jeff Lu wrote: > > I've downloaded and installed cygwin & gdbm-1.8.0. Please read /usr/doc/Cygwin/gdbm-1.8.0.README. Basically, gdbm provides wrapper header files so that you can use gdbm to provide dbm and ndbm functions -- but you must link to the gdbm library to do so. -lgdbm. Also, since by default ld will link using the dll, the header files reflect this. That's why you get _imp__dbm_open. If you want to link statically, you have to (a) set CFLAGS=-DGDBM_STATIC when compiling, and use "-static" when linking. Then, functions don't get renamce (that's part (a)) and you link to the statlib instead of the dll-importlib (that's part (b)). Please search the archives; there have been several links to informative webpages posted recently concerning dll's and how they work. --Chuck > > When tried to compile programs that uses dbm functions such as: > > gcc -o /home/jeff/getzip.cgi getzip.c utils.c -lndbm > > I got /usr/bin/ld: cannot find -lndbm > > gcc -o /home/jeff/getzip.cgi getzip.c utils.c -lgdbm > I got errors on dbm_open, dbm_fetch etc as undefined reference > > Please see attached error file. > > This is weird. Some dbm calls got renamed to "_imp__dbm_open" during > compile. > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com