*BSD News Article 24809


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!mel.dit.csiro.au!its.csiro.au!dmssyd.syd.dms.CSIRO.AU!metro!basser.cs.su.oz.au!news.adelaide.edu.au!gateway.dircsa.org.au!apanix!apanix!not-for-mail
From: hart@apanix.apana.org.au (Leigh Hart)
Newsgroups: comp.os.386bsd.questions
Subject: Re: dirent.h
Date: 9 Dec 1993 01:25:43 +1030
Organization: APANIX Public Access Unix, Australia, +61-8-373-5485 (3 lines)
Lines: 37
Message-ID: <2e4ptf$j1d@olivaw.apanix.apana.org.au>
References: <2dlrii$6so@terminator.rs.itd.umich.edu>
NNTP-Posting-Host: olivaw.apanix.apana.org.au

altitude@css.itd.umich.edu (Alex Tang) writes:

>Hi.  I'm running NetBSD-0.8.  I'm trying to build httpd, but i'm having a
>peculiar problem.  I keep getting errors from within the file
>/usr/include/dirent.h, (when i use cc), and
>/usr/local/lib/gcc-lib/i386--bsd.4.3/2.4.3/include (when I use gcc-2.4.5), 

>it's saying:

>cc -c -g -O -traditional  http_config.c
>In file included from /usr/include/sys/dir.h:44, from httpd.h:83, from
>http_config.c:9:
>/usr/include/dirent.h:48: syntax error before `u_long'

>I'm confused.  What do i need to do?

From experience this is because the compiler doesn't know what u_long is.

u_long is type defined (typedef) in <sys/types.h> as an unsigned long,
and if <sys/types.h> is not included before a header file that uses
these definitions, then you get syntax errors.

Just thwack 

#include <sys/types.h>

in the top of your source file (http_config.c) and it should be
hunky dory. (before dir.h, as dir.h includes dirent.h)

Cheers

Leigh
-- 
                                 Leigh Hart
                               C/- PO Box 758
                          North Adelaide  SA  5006
 hart@eppie.apana.org.au  hart@apanix.apana.org.au  hart@cleese.apana.org.au