From owner-freebsd-questions Tue Jan 9 17:26:47 2001 Delivered-To: freebsd-questions@freebsd.org Received: from xena.gsicomp.on.ca (cr677933-a.ktchnr1.on.wave.home.com [24.43.230.149]) by hub.freebsd.org (Postfix) with ESMTP id 825C137B402 for ; Tue, 9 Jan 2001 17:26:29 -0800 (PST) Received: from localhost (matt@localhost) by xena.gsicomp.on.ca (8.9.3/8.9.3) with ESMTP id UAA53355; Tue, 9 Jan 2001 20:25:39 -0500 (EST) (envelope-from matt@xena.gsicomp.on.ca) Date: Tue, 9 Jan 2001 20:25:38 -0500 (EST) From: Matthew Emmerton To: "Geoffrey Crompton (RMIT Guest)" Cc: FreeBSD-Questions Subject: Re: programming in freebsd related questions In-Reply-To: <20010110121911.A29635@gecko.eric.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 10 Jan 2001, Geoffrey Crompton (RMIT Guest) wrote: > When I #include things like sys/socket.h and netinet/in.h, I get heaps > of compiler errors, unless I do a #include before I #include > the others. Why is that? Because that's the way it is. defines many things that are used by other header files, such as and , so you have to include it first, as you've found out. Depending on your program, you may need to include _instead of_ . (You can't include both.) > Also, I've noticed multiple copies of socket.h, sitting in /usr/src/sys, > and /usr/include. I think that /usr/src is where the kernel all get's built > from. Does the make build/installworld process copy all the header > files that a user application might want over to the /usr/include area? Yes. > If I'm hunting through header files for definitions, which ones should I use? Since it's possible for the headers in /usr/src to be a different version than the ones in /usr/include, you want to use the ones in /usr/include. -- Matt Emmerton GSI Computer Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message