Re: Trouble compiling on cygwin

Jim Hague <[email protected]> Sun, 09 Nov 2003 21:29:19 -0000 (GMT)
Newsgroups gmane.network.noffle.user
Organization The Bear Cave
Message-ID <[email protected]>
On 09-Nov-2003 Rolf Leggewie wrote:
> I have some trouble to compile noffle for use in my Cygwin system.
> [...]
>|  gcc  -g -O2  -o noffle  authenticate.o client.o configfile.o content.o
>|  control.o
>|   database.o dynamicstring.o expire.o fetch.o fetchlist.o filter.o group.o
>|   itemli
>|  st.o lock.o log.o noffle.o online.o outgoing.o over.o post.o protocol.o
>|  pseudo.o
>|   request.o server.o util.o wildmat.o -lgdbm
>|  database.o: In function `errMsg':
>|  /usr/src/noffle-1.1.5/src/database.c:67: undefined reference to
>|  `gdbm_errno'
>|  group.o: In function `errMsg':
>|  /usr/src/noffle-1.1.5/src/group.c:67: undefined reference to `gdbm_errno'
>|  collect2: ld returned 1 exit status
>|  make[2]: *** [noffle] Error 1
>|  make[2]: Leaving directory `/usr/src/noffle-1.1.5/src'
>|  make[1]: *** [all-recursive] Error 1
>|  make[1]: Leaving directory `/usr/src/noffle-1.1.5'
>|  make: *** [all-recursive-am] Error 2

I must confess that while I have built Noffle on Cygwin in the past, it
was a one-off. I don't have regular access to a Windows machine to keep Noffle
up to date on Cygwin.

That being said, it looks to me like this isn't far from working. I notice that
the configure seems to have found gdbm.h and found gdbm_open, which implies it
found the gdbm library.

Your problem is coming at link time, when gdbm_errno isn't found in the library.
This is rather curious.

> I am no expert at compiling things.  From what I gathered in the gdbm
> manpage, gdbm_errno should be available in gdbm.h which resides in
> /usr/include.  Explicitly passing --includedir=/usr/include and
> --with-gdbm-include=/usr/include to ./configure did not alleviate the
> problem.

From what I can see, finding gdbm.h isn't the problem. The problem is with
the gdbm library, which will be either libgdbm.a or libgdbm.so. Either this
library isn't being found - which is strange, as the configure says it found it
- or it is missing gdbm_errno. Which is equally strange.

First, check the version of GDBM you have installed. You should have
CygWin packages libgdbm *and* libgdbm-devel installed. In usr/share/doc/ there
should be a libgdbm-devel directory with a version number; e.g.
libgdbm-devel-1.8.3 (the current version). What is the version number? How up
to date is your CygWin installation?

Secondly, can you find the GDBM library - which will be /usr/lib/libgdbm.a. Do
you get anything from running the command 'strings /usr/lib/libgdbm.a | grep
gdbm_errno'?

Finally, also try reconfiguring with --enable-debug=yes, and then rebuild. That
will enable a good number of compiler warnings, and there may be a clue there.

-- 
Jim Hague - [email protected]          Never trust a computer you can't lift.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/