* gcc not recognizing C++ keywords
@ 2004-02-25 16:22 Eric Evans
2004-02-25 16:53 ` Eljay Love-Jensen
0 siblings, 1 reply; 3+ messages in thread
From: Eric Evans @ 2004-02-25 16:22 UTC (permalink / raw)
To: gcc-help
Hello,
Sorry to have to ask what will probably seem like a stupid question. But
I'm kindof desperate here. I am trying to compile (with make) a program on
a RH 9 machine with gcc 3.2.2. The compilation fails with lots of parsing
errors, and it seems that all of the parsing errors are caused by gcc
failing to recognize C++ keywords such as class, public, etc. It would
seem, at least to my unexpert eye (I'm a newcomer to gcc), that gcc is
trying to compile this thing as a C program instead of as a C++
program. Yet I've been told that this program has been compiled
successfully on other Linux systems.
I've emailed the author of the program for advice but this person is either
ignoring me or is too busy to reply. It occurs to me that I might not ever
get a reply from the program's author, hence this plea for help.
I didn't want to include the whole Makefile in this message because it's
rather large. But does anybody out there have some suggestions for things
I should look for in the Makefile that might have some bearing on this
problem? Since I'm rather naive about gcc, I'd appreciate any advice on
how I could get started in troubleshooting this problem. Thanks very much.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gcc not recognizing C++ keywords
2004-02-25 16:22 gcc not recognizing C++ keywords Eric Evans
@ 2004-02-25 16:53 ` Eljay Love-Jensen
2004-02-25 17:59 ` Eric Evans
0 siblings, 1 reply; 3+ messages in thread
From: Eljay Love-Jensen @ 2004-02-25 16:53 UTC (permalink / raw)
To: Eric Evans, gcc-help
Hi Eric,
Is the compile doing: "g++ -o foo foo.cpp" ?
Or is the compile doing: "gcc -o foo foo.c" ?
Note, with GCC, C++ programs should use "g++" and have the extension .cpp
.cc .cxx .c++ .cp or .C (capital C, on case-sensitive file systems only).
The extension can be ignored if "-x c++" is being used, since that
overrides the extension check.
HTH,
--Eljay
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gcc not recognizing C++ keywords
2004-02-25 16:53 ` Eljay Love-Jensen
@ 2004-02-25 17:59 ` Eric Evans
0 siblings, 0 replies; 3+ messages in thread
From: Eric Evans @ 2004-02-25 17:59 UTC (permalink / raw)
To: Eljay Love-Jensen, gcc-help
Hi,
Yes, you were quite right! It is working now. Thanks so much for the tip.
Eric
>Is the compile doing: "g++ -o foo foo.cpp" ?
>
>Or is the compile doing: "gcc -o foo foo.c" ?
>
>Note, with GCC, C++ programs should use "g++" and have the extension .cpp
>.cc .cxx .c++ .cp or .C (capital C, on case-sensitive file systems only).
>
>The extension can be ignored if "-x c++" is being used, since that
>overrides the extension check.
>
>HTH,
>--Eljay
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-25 16:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25 16:22 gcc not recognizing C++ keywords Eric Evans
2004-02-25 16:53 ` Eljay Love-Jensen
2004-02-25 17:59 ` Eric Evans
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).