From: "Claudio Bley" <bley@cs.uni-magdeburg.de>
To: gcc-help@gcc.gnu.org
Subject: Re: can't find c++ header files
Date: Thu, 11 Jul 2002 14:03:00 -0000 [thread overview]
Message-ID: <15661.62094.774101.290394@wh2-19.st.uni-magdeburg.de> (raw)
In-Reply-To: <20020711195306.E5862@auburn.edu>
>>>>> "Todd" == Todd Kokoszka <kokostm@auburn.edu> writes:
Todd> Hello,
Todd> I recently installed gcc 3.0.4 while keeping gcc 2.95.3 on
Todd> my machine. I'd like to use 3.0.4 to compile c++ and java
Todd> programs. I didn't know where to put the c++ parts of 3.0.4
Todd> that I want to use without screwing up the 2.95.3 C stuff,
Todd> so I stuck 3.0.4 in /usr/local/gcc-3.0.4 -- maintaining the
Todd> installation hierarchy.
Todd> When I try to compile a simple c++ program, that just prints
Todd> the value of a variable, the compiler tells me that cout and
Todd> endl are not declared. I included the iostream header, set
Todd> the CPLUS_INCLUDE_PATH, and COMPILER_PATH environement
Todd> varialbes to the new location under /usr/local/gcc-3.0.4 and
Todd> even passed the directory with -I. I tried using the
Todd> standard #include <iostream> and #include "direct path to
Todd> file" and neither worked.
Why didn't you simply post the code, the command line you've used to
compile your program and the error messages of GCC instead of vaguely
describing what you did?
Also, it's quite a difference if GCC said that cout and endl are not
defined or that it couldn't find the header file.
You may use the -v switch of GCC in order to find out where it looks
for its header files.
Be aware that cout and endl are defined in namespace std. So, you need
to specify the namespace explicitly ( std::cout << "hello" <<
std::endl; ) or add a `using' declaration to your code ( using
namespace std; OR using std::cout; using std::endl; ).
Todd> If anyone has any ideas what I'm missing or where to find
Todd> information abou t how to install two compilers like I want
Todd> to, I'm happy to hear them.
HTH
Claudio
prev parent reply other threads:[~2002-07-11 21:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-11 13:06 Todd Kokoszka
2002-07-11 14:03 ` Claudio Bley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15661.62094.774101.290394@wh2-19.st.uni-magdeburg.de \
--to=bley@cs.uni-magdeburg.de \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).