Mail Archives: djgpp/2000/05/13/18:12:14

Date: Sat, 13 May 2000 17:20:19 -0400 (EDT)
Message-Id: <>
From: Eli Zaretskii <eliz AT delorie DOT com>
To: "Djani Buric" <djburic AT yahoo DOT com>
CC: djgpp AT delorie DOT com
In-reply-to: <8fht74$rvc$> (
Subject: Re: Compiling dvipdfm with DJGPP
References: <8fht74$rvc$1 AT as102 DOT tel DOT hr>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Djani Buric" <djburic AT yahoo DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 12 May 2000 23:30:47 +0200
> 2. Set environment variables:
> set CC=gcc
> set CPPFLAGS=-Ic:/djgpp/include/kpathsea
> set LDFLAGS=-Lc:/djgpp/lib
> (If CC is not set, configure refuses to work. I don't know whether
> CPPFLAGS and LDFLAGS should be set or not. It doesn't seem to make a
> difference.)
> 3. Replaced every occurrence of /bin/sh in configure with /djgpp/bin/sh
> (otherwise sh could not be found) and started it from within bash with
> './configure --prefix=c:/djgpp'.

What version of Bash do you have?  Version 2.03 and later comes with a
file which, if installed in %DJDIR%/share, should take
care of all those problems automagically.

Anyway, if you got past the configure step, you may stop worrying
about this.

> gcc -g -O2 -I .  -c -o pdfdev.o pdfdev.c
> In file included from c:/djgpp/include/kpathsea/config.h:65,
>                  from c:/djgpp/include/kpathsea/kpathsea.h:1,
>                  from system.h:6,
>                  from pdfdev.c:29:
> c:/djgpp/include/kpathsea/lib.h:117: conflicting types for `basename'
> c:/djgpp/include/unistd.h:128: previous declaration of `basename'

This says that kpathsea/lib.h has a prototype for the function
`basename', and that prototype is different from the one in the system
header unistd.h.

What should have happened was that the configure script should have
tested whether your library has a `basename' function, and if so,
refrain from using the replacement version of `basename' which comes
with Kpathsea.  This should work automatically if Kpathsea is
configured for the same version of DJGPP that you have installed.

I'm guessing that you installed only, but didn't install
Kpathsea's sources.  In that case, what you are using is the version
of kpathsea/lib.h that was configured for DJGPP v2.01, where
`basename' was not available in the library.  That's why the prototype
of `basename' in kpathsea/lib.h is visible to the compiler, and that's
why you see this problem.

To solve this problem, I suggest to edit the file pdfdev.c, find the
line which says this:

 #include <unistd.h>

and replace this line with the following:

 #define basename djgpp_basename
 #include <unistd.h>
 #undef basename

(If this line is not in pdfdev.c, you will have to look for it in some
header file #include'd by pdfdev.c.)

Warning: this solution is a hack!  The *real* solution would be to
download the Kpathsea sources and reconfigure and rebuild it with
DJGPP v2.03.  However, I think what I suggest is worth trying, since
it is much easier and quicker.

- Raw text -

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