From owner-freebsd-questions Wed Dec 25 6: 3:17 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1D3637B401 for ; Wed, 25 Dec 2002 06:03:15 -0800 (PST) Received: from east.ath.cx (catv-50622a7a.nyircatv.broadband.hu [80.98.42.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44C2743EE1 for ; Wed, 25 Dec 2002 06:03:13 -0800 (PST) (envelope-from witch@kronos.HomeUnix.com) X-Complaints-To: abuse@kronos.homeunix.com X-SMTP-Authenticated: CRAM-MD5 Received: from slave.east.ath.cx (mlr8gpz4ipl4zzjp@slave.kronos.homeunix.com [10.1.1.1]) (authenticated bits=0) by east.ath.cx (8.12.6/8.12.6) with ESMTP id gBPE3BIW043448 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Wed, 25 Dec 2002 15:03:11 +0100 (CET) (envelope-from witch@slave.east.ath.cx) Received: from slave.east.ath.cx (localhost [127.0.0.1]) by slave.east.ath.cx (8.12.6/8.12.6) with ESMTP id gBPE3Brb056515 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 25 Dec 2002 15:03:11 +0100 (CET) (envelope-from witch@slave.east.ath.cx) Received: (from witch@localhost) by slave.east.ath.cx (8.12.6/8.12.6/Submit) id gBPE366U056483; Wed, 25 Dec 2002 15:03:06 +0100 (CET) Date: Wed, 25 Dec 2002 15:03:06 +0100 (CET) From: Andrew Prewett Reply-To: Andrew Prewett To: FreeBSD Questions Subject: Re: Adding to standard include path (GCC) In-Reply-To: <200212251952.23932.ihsan_junaidi@yahoo.com.sg> Message-ID: <20021225141213.R35290@slave.east.ath.cx> References: <200212251952.23932.ihsan_junaidi@yahoo.com.sg> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Today Ihsan Junaidi Ibrahim wrote: > Hello all, > > I'm a starter to programming in FreeBSD after a few years in Visual C++ and > would like to delve deeper into it. But I have a few questions which I need > answers. I hope it wouldn't be too much a burden to you. > > I have two gccs installed, 2.95.4 (stock gcc) and 3.1.1. > > 1) How do add to the standard include path to a path that I designated without > using the -I flag or is it fixed only to /usr/local/include and /usr/include. You can edit the `specs' file, but you don't need. gcc31 -v -E -dM - > 2) I notice that the gcc31 include files does not contain the standard C > headers ie stdio.h, assert.h etc. Does this mean whenever I want to link to > the header, it is sufficient to use the ones in /usr/include? if you mean include a header, then yes, for C code. Simply use `#include <*.h>' in the C source (both gcc) > 3) I notice too that there are many C++ and STL include files I'm getting > confused on which ones to use. The files are located at /usr/include/g++, this is for use with the system gcc (2.95) > /usr/local/lib/i386-portbld-freebsd4.7/3.1.1/include/g++v3 and this is for the new gcc (3.x) > /usr/local/lib/i386-portbld-freebsd4.7/3.1.1/include/g++v3/backward. this is for (older) C++ souces with `#include <*.h>' (gcc 3.x) > Can someone enlighten me on which one should I use. use the standard include files, ie.: `#include ', `#include ', etc. in C++ source and (normally) the right header is pulled in > I intend on programming purely in C++ with the exception that in > later date, I might be forced to use some of the C include files. simply use `#include , #include ', etc. in the C++ source -andrew > > Thank you very much in advance. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message