This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem In compiling C++ codes


Aref, et al --

It appears that you replied only to Sherry after she replied to you, so
I'm stepping into the discussion late...


...and then sherry said...
% aaboulhosn@entpm2.prod.fedex.com wrote:
% 
% > I appreciate your response.
% >
% >   1)   I  Tried to put  the whole path in my C++ program like this:
% >         #include   <path directory for my header file/iostream.h>
% >
% >    and tried to compile, it does not work.
% >   is there any other way, to include the path  name ?
% 
% Check the PATH environment variable:
%     echo $PATH should give you that , you can modify it also.

Actually, the shell's $PATH variable doesn't have to do with your
code's #include directives.  In the case above, you should leave off 
the <> and just specify something like

  #include /path/to/headers/iostream.h

(whereas using <iostream.h> will pick up the *system's* copy of the
header file).


% >
% >  2)  If I have  an : a.out     execuatble file
% >        when I type:  a.out     It does not find the link library
% 
% this problem can be related to the path also.

Yep; you probably don't have (and shouldn't have!) '.', or the current
directory, in your path.  Instead of typing

  a.out

to run your program, simply type

  ./a.out

to tell the shell to look in the current directory.


% 
% >
% >
% >  3)  what is the extension for the source file , in C++ and how to compile
% > it ?
% 
% man g++ will help you :)

That's probably the best answer :-)


% 
% >
% >
% >        I know  for my C program, example:
% >
% > filename.c
% > To compile :    gcc    filename.c
% >
% > Thank you
% 
% welcome

HTH & HAND


:-D
-- 
David T-G                       * It's easier to fight for one's principles
(play) davidtg@bigfoot.com      * than to live up to them. -- fortune cookie
(work) davidtgwork@bigfoot.com
http://www.bigfoot.com/~davidtg/        Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]