From owner-freebsd-questions Sat Oct 5 16:42:39 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 BB65137B401 for ; Sat, 5 Oct 2002 16:42:36 -0700 (PDT) Received: from vectors.cx (manifold.vectors.cx [64.163.147.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46D0543E4A for ; Sat, 5 Oct 2002 16:42:36 -0700 (PDT) (envelope-from monkey@vectors.cx) Received: from vectors.cx (ab04f99c742d5e232bdf2fef8bc50919@localhost [127.0.0.1]) by vectors.cx (8.12.6/8.12.4) with ESMTP id g95NhZho040608; Sat, 5 Oct 2002 16:43:35 -0700 (PDT) (envelope-from monkey@vectors.cx) Received: (from monkey@localhost) by vectors.cx (8.12.6/8.12.6/Submit) id g95NhZxY040607; Sat, 5 Oct 2002 16:43:35 -0700 (PDT) (envelope-from monkey) Date: Sat, 5 Oct 2002 16:43:35 -0700 From: Adam Weinberger To: Wayne Lubin Cc: freebsd-questions@freebsd.org Subject: Re: adding a path to gcc to find #include type includes Message-ID: <20021005234335.GI45363@vectors.cx> References: <20021005225724.GF45363@vectors.cx> <20021005230930.50079.qmail@web14701.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021005230930.50079.qmail@web14701.mail.yahoo.com> X-Editor: Vim 6.1 http://www.vim.org X-Mailer: Mutt 1.5 http://www.mutt.org X-URL: http://www.vectors.cx http://www.crackula.com User-Agent: Mutt/1.5.1i 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 wayne - i hope this email helps you out, and gets you on the way towards feeling as comfortable as you please around the compiler. you have the right idea all the way across; you're just not implementing it correctly. >> (10.05.2002 @ 1609 PST): Wayne Lubin said, in 2.9K: << > #include > #include k. this tells you that the compiler is going to want to look for the file PalmOS.h *in one of the directories in the path*. so, if you don't see PalmOS.h in /usr/include, you have to tell it where to find the file. you have to tell the compiler "look for PalmOS.h relative to _____ directory." for reference, if the line were: #include then your question would be "in what directory would i find palm/PalmOS.h?" make sense? > I get the error mesagaes > > Main.c:13: BuildDefines.h: No such file or directory > Main.c:17: PalmOS.h: No such file or directory right. the compiler says "i'm looking in /usr/include and /usr/local/palmdev for PalmOS.h, but i can't find /usr/include/PalmOS.h or /usr/local/palmdev/PalmOS.h." > In other words it is not finding the files. But these > files are in > > /usr/local/palmdev/sdk-3.5/include ok. there you go. you need to tell the compiler "look for PalmOS.h in that directory." the syntax is with the -I switch, as you correctly identified. cc -I/usr/local/palmdev/sdk-3.5/include Main.c that's your magic command line. > In fact, PalmOS.h and BuildDefines.h include more > files that are in > /usr/local/palmdev/sdk-3.5/include/Core/ ok. if the files are #included as then you're fine. the compiler will say, "can i find the file Core/whatever.h in /usr/local/palmdev/sdk-3.5/include?" > Seems like there has to be a way to add a search path > to gcc to look for included files that are of the type > #include . It would be a pain if I had to > manually put all the needed files into /usr/include. HTH. -Adam -- "Oh good, my dog found the chainsaw." -Lilo, "Lilo & Stitch" Adam Weinberger adam@vectors.cx http://vectors.cx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message