List Info

Thread: editing the search path for '#include' preprocessor




editing the search path for '#include' preprocessor
user name
2007-06-27 05:05:46
hello,
i want to add new search path's for including  more
directories for header
files, for that i need to edit the makefile that my gcc
compiler uses,
however i cant figure out where to find that file, kindly
help..i'm a newbie
who has just started out
regards,
sameer
_______________________________________________
freebsd-questionsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribefreebsd.org"

Re: editing the search path for '#include' preprocessor
country flaguser name
United States
2007-06-27 08:10:57
Written by sameer gupta on 06/27/07 05:05>>
> hello,
> i want to add new search path's for including  more
directories for header
> files, for that i need to edit the makefile that my gcc
compiler uses,
> however i cant figure out where to find that file,
kindly help..i'm a 
> newbie
> who has just started out
> regards,
> sameer

If you're wanting to add system include paths permanently to
gcc, AFAIK 
you'll have to edit /usr/src/contrib/gcc/cppdefaults.c and
add the paths 
you want to the cpp_include_defaults array. However, cpp
already has a 
non-invasive way of supplying extra include paths with the
-I flag, or 
you can set the CPATH environemtn vairable to the paths you
would like 
to search (its form is exactly like that of PATH).

_______________________________________________
freebsd-questionsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribefreebsd.org"

Re: editing the search path for '#include' preprocessor
country flaguser name
Netherlands
2007-06-27 10:38:30
On Wed, Jun 27, 2007 at 03:35:46PM +0530, sameer gupta
wrote:
>  hello,
>  i want to add new search path's for including  more
directories for header
>  files, for that i need to edit the makefile that my
gcc compiler uses,
>  however i cant figure out where to find that file,
kindly help..i'm a newbie
>  who has just started out

You can set environment variables to help GCC find include
files and
libraries in your shell's startup script. For include files
you can set
CPATH, for libraries you'll need to set LIBRARY_PATH. See
http://gcc.gnu.org/onlinedocs/gcc/Environment-Variab
les.html

Both can contain different paths separated by a colon (.

How to set environment variables depends on the shell you
use. csh uses
the 'set' command, while sh and bash use 'export'. See your
shell's
manual page for details.

Roland
-- 
R.F.Smith                                   http://www.xs4all.nl/~r
smith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much
appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725
(KeyID: C321A725)
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )