gcc seems okay but g++ not able to get path to compile

Philip Herron redbrain@gcc.gnu.org
Thu Sep 16 23:35:00 GMT 2010


On 16 September 2010 22:04, gagan1 <gagan2172@yahoo.com> wrote:
>
> Chaps,
>              Is that some different way in which g++ needs path information
> for the source cpp & header file to get compiled.
>
> I am trying to compile a code with GCC. Since it is c++ code. It appears g++
> is automatically get invoked
> So while the gcc is okay but g++ compliains about no file or directory error

What platform are you running on?

>
> I copy the file and put in same location from where I am running the
> makefile.

You mean you copied system headers into your src directory?

>
> This seems to work but now all the system header files that are listed in
> that cpp file is missing as per g++!!!
>

If all your using is standard system headers g++ should pick them up
as per defaults in /usr/include

> I don't think it is goo idea to copy all system or no system header files in
> same folder to get g++ work. Thier should be some way to let g++ know the
> path
>

nope

> At the moment in my standard makefile I am using flag -I to include header
> files
>

Define standard i don't think there is a "standard makefile". What
options are you using to invoke gcc. We need an example of what your
trying to do so we can help. So show us a small test case of the
failing code and what your gcc options are etc.

--Phil



More information about the Gcc-help mailing list