Problem In compiling C++ codes
David T-G
davidtg@bigfoot.com
Thu Feb 22 12:18:00 GMT 2001
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
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE6lXP8UScpmrZtnuoRAiHCAJ9H9GvFkWeCw8fp5PIPaK+iQ637BQCeMSLY
oukpqRoo3MNklT4NRgdjrA4=
=GpCO
-----END PGP SIGNATURE-----
More information about the Gcc-help
mailing list