delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/10/23/20:29:44

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <39F4D7B9.EA33204A@ece.gatech.edu>
Date: Mon, 23 Oct 2000 20:28:41 -0400
From: "Charles S. Wilson" <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.75 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Jeff Lu <jklcom AT mindspring DOT com>
CC: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Question
References: <NDBBIHPECLIGKCCLMACAEEHHCHAA DOT jklcom AT mindspring DOT com>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019