delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
To: | cygwin AT cygwin DOT com |
X-Injected-Via-Gmane: | http://gmane.org/ |
Path: | not-for-mail |
From: | Soren A <soren_andersen AT fastmail DOT fm> |
Newsgroups: | gmane.os.cygwin |
Subject: | Re: Best environment setup for using gcc? |
Date: | Wed, 21 Aug 2002 05:30:30 +0000 (UTC) |
Organization: | Occasionally Sporadically |
Lines: | 66 |
Message-ID: | <Xns9271F8C7A0CFsoren1Gmane@80.91.224.249> |
References: | <004701c24702$a4dabae0$b2b1869f AT oemcomputer> |
NNTP-Posting-Host: | ny-kenton2a-572.buf.adelphia.net |
X-Trace: | main.gmane.org 1029907830 24073 24.51.94.60 (21 Aug 2002 05:30:30 GMT) |
X-Complaints-To: | usenet AT main DOT gmane DOT org |
NNTP-Posting-Date: | Wed, 21 Aug 2002 05:30:30 +0000 (UTC) |
User-Agent: | Xnews/L5 |
X-Archive: | encrypt |
"Al" <nobrow AT eircom DOT net> wrote around 18 Aug 2002 news:004701c24702$a4dabae0$b2b1869f AT oemcomputer about %s: > Hi. Ive got a rather simple question (which strangly I have had great > difficulty expressing) about whats considered best practice when it > comes to setting up gcc. It's OK, you needed to ask it because you've been laboring under a misconception. > I installed cygwin the other day. Up to that point I was using a > version of gcc that came as part of a program called Dev C++ from > Bloodshed (I think that gcc came from mingw). Anyway, then I had it > setup so that my PATH included both the path to the bin and include > directories. Include contained all the common headers including, for > example, the windows ones so this simple setup worked fine and I > rarely had to worry about telling the compiler where to locate > included files. You are mistaken in thinking that your PATH setting was helping gcc find your include headers. PATH is universally used only for finding commands to execute. It pertains to no other kind of task or file. MinGW GCC was finding the headers it needed to for other reasons. There are other settings that are "PATHS" (token-delimited lists of directories or meta-directories -- of the latter I mean those aware at all of Java would perhaps say that a JAR file name placed into one's CLASSPATH env variable is a sort of "meta-directory", for instance). These other settings -- environmental variables or "macros" to some -- are program-specific. `CLASSPATH' as just cited would be one example. In this case the relevant variable is INCLUDE_PATH. By default, the INCLUDE_PATH variable is undefined or does not contain any directories. Multiple entries must be separated by a colon on Unix-like systems (of which Cygwin is one). You can accomplish the same thing on the command line used to invoke the C pre-processor and it's debatable whether you even need to know about INCLUDE_PATH. > Now Im not sure what I should set my PATH to so that I will be able to > launch gcc (the one I got with cygwin) from dos or from other programs > without worrying about it being able to access the headers. Also I > dont know if I have to do stuff to make the include files accessible > when I use gcc from bash. I looked at the output from gcc > -print-search-dirs but it didnt help me. So how does eveyone else have > their environments set up? I cant just set my PATH to point to > usr\include because a lot of the headers are nested in other > directories like w32api. Is it considered bad to have the kind of > setup Im talking about and should just be telling it what directories > to search each time I invoke gcc? Help me conform ... You should take special care to remove from your PATH all directory entries that might cause a MinGW tool (program / command) to be found where you are intending to use Cygwin. Do NOT mix the two. You should also, I might advise you in a well-meaning way, start to become accustomed to the notion that the Cygwin List community isn't a place that is uniformly friendly to this kind of posting. Your question is not considered Cygwin-specific but rather goes to general (and extremely basic) knowledge of shells and of gcc, and the docs at www.gnu.org -> gcc would be a good place to initiate a long self-administered course of study which you need to start to accomplish if you intend to follow the important porgrammer axiom of "know thy tools!". That is in addition to the reading you have right under your fingertips in the form of `info gcc' (that was a command for you to type into your bash session). Best, Soren Andersen -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |