Re: editing the search path for '#include' preprocessor
On Fri, Jun 29, 2007 at 12:03:11PM +0530, sameer gupta wrote: > thanks, > however i would like to add more details of my problem: > > > > cd /usr/home/sameer/ > gcc -o prog1 prog1.c -lelf -I /usr/local/include/libelf > In file included from prog1.c:3: > /usr/local/include/libelf/libelf.h:31:28: libelf/sys_elf.h: No such file or So you need to specify -I/usr/local/include too. > directory > In file included from prog1.c:3: > /usr/local/include/libelf/libelf.h:185: error: syntax error before '*' > token > /usr/local/include/libelf/libelf.h:185: warning: data definition has no > type > or storage class > /usr/local/include/libelf/libelf.h:187: error: syntax error before '*' > token > /usr/local/include/libelf/libelf.h:187: warning: data definition has no > type > or storage class > /usr/local/include/libelf/libelf.h:189: error: syntax error before '*' > token > /usr/local/include/libelf/libelf.h:189: warning: data definition has no > type > or storage class > /usr/local/include/libelf/libelf.h:194: error: syntax error before '*' > token > /usr/local/include/libelf/libelf.h:194: warning: data definition has no > type > or storage class > /usr/local/include/libelf/libelf.h:195: error: syntax error before '*' > token > /usr/local/include/libelf/libelf.h:195: warning: data definition has no > type > or storage class > prog1.c: In function `main': > prog1.c:28: error: syntax error before ';' token > > Compilation exited abnormally with code 1 at Fri Jun 29 17:15:34 > > > > > > > :::even though the sys_elf.h exists under the folder i specified using the > -I flag while compiling still my compiler cant find the header > kindly suggest, > regards, > sameer > > > > > > On 6/27/07, Roland Smith <[EMAIL PROTECTED]> wrote: >> >> 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-Variables.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/~rsmith/ >> [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] >> pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) >> >> Yuri pgpDajmEMZdha.pgp Description: PGP signature
Re: editing the search path for '#include' preprocessor
thanks, however i would like to add more details of my problem: cd /usr/home/sameer/ gcc -o prog1 prog1.c -lelf -I /usr/local/include/libelf In file included from prog1.c:3: /usr/local/include/libelf/libelf.h:31:28: libelf/sys_elf.h: No such file or directory In file included from prog1.c:3: /usr/local/include/libelf/libelf.h:185: error: syntax error before '*' token /usr/local/include/libelf/libelf.h:185: warning: data definition has no type or storage class /usr/local/include/libelf/libelf.h:187: error: syntax error before '*' token /usr/local/include/libelf/libelf.h:187: warning: data definition has no type or storage class /usr/local/include/libelf/libelf.h:189: error: syntax error before '*' token /usr/local/include/libelf/libelf.h:189: warning: data definition has no type or storage class /usr/local/include/libelf/libelf.h:194: error: syntax error before '*' token /usr/local/include/libelf/libelf.h:194: warning: data definition has no type or storage class /usr/local/include/libelf/libelf.h:195: error: syntax error before '*' token /usr/local/include/libelf/libelf.h:195: warning: data definition has no type or storage class prog1.c: In function `main': prog1.c:28: error: syntax error before ';' token Compilation exited abnormally with code 1 at Fri Jun 29 17:15:34 :::even though the sys_elf.h exists under the folder i specified using the -I flag while compiling still my compiler cant find the header kindly suggest, regards, sameer On 6/27/07, Roland Smith <[EMAIL PROTECTED]> wrote: 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-Variables.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/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: editing the search path for '#include' preprocessor
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-Variables.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/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpvbEXPsmQ7m.pgp Description: PGP signature
Re: editing the search path for '#include' preprocessor
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-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
editing the search path for '#include' preprocessor
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-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"