* g++ problems
@ Kyrath. (AKA Rob)
` Sina Bahram
` (2 more replies)
0 siblings, 3 replies; 24+ messages in thread
From: Kyrath. (AKA Rob) @ UTC (permalink / raw)
To: Speakup
Hi,
A few of you have been trying to help me get going with compiling C++ code, but so far there's been no joy.
The messages I'm getting are scrolling off the screen, but quite a few of them refer to:
/usr/include/c++/3.2.3/i486-slackware-linux/bits/gthr-default.h
Is there something that needs to be done to gcc before it becomes fully operational?
Here's a copy of the code I last tried to compile:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
return 0;
}
Also, I was informed by a few of you that the modern C++ uses "iostream" with a "using namespace std;" instead of the "iostream.h" for the include.
Does this mean that gcc is not backward compatible and will not compile older source code without modifications?
Thanks
-- Rob
^ permalink raw reply [flat|nested] 24+ messages in thread
* RE: g++ problems
g++ problems Kyrath. (AKA Rob)
@ ` Sina Bahram
` Kyrath. (AKA Rob)
` Tom and Esther Ward
` Luke Davis
2 siblings, 1 reply; 24+ messages in thread
From: Sina Bahram @ UTC (permalink / raw)
To: 'Speakup is a screen review system for Linux.'
Use g++ not gcc
Gcc is for c and g++ is for c++
Take care,
Sina
No trees were destroyed in sending this message; however, a large number of
electrons were terribly inconvenienced.
-----Original Message-----
From: speakup-bounces@braille.uwo.ca [mailto:speakup-bounces@braille.uwo.ca]
On Behalf Of Kyrath. (AKA Rob)
Sent: Wednesday, March 31, 2004 3:44 PM
To: Speakup
Subject: g++ problems
Hi,
A few of you have been trying to help me get going with compiling C++ code,
but so far there's been no joy.
The messages I'm getting are scrolling off the screen, but quite a few of
them refer to:
/usr/include/c++/3.2.3/i486-slackware-linux/bits/gthr-default.h
Is there something that needs to be done to gcc before it becomes fully
operational?
Here's a copy of the code I last tried to compile:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
return 0;
}
Also, I was informed by a few of you that the modern C++ uses "iostream"
with a "using namespace std;" instead of the "iostream.h" for the include.
Does this mean that gcc is not backward compatible and will not compile
older source code without modifications?
Thanks
-- Rob
_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Sina Bahram
@ ` Kyrath. (AKA Rob)
` Sina Bahram
` (2 more replies)
0 siblings, 3 replies; 24+ messages in thread
From: Kyrath. (AKA Rob) @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Been there, done that, same result.
Besides, I thought that I had read that gcc was used with a few different
languages. *shrug*
Don't c++ compilers, by default, compile c code? C++ is a superset of C,
right?
-- Rob
----- Original Message -----
From: "Sina Bahram" <sbahram@nc.rr.com>
To: "'Speakup is a screen review system for Linux.'"
<speakup@braille.uwo.ca>
Sent: Wednesday, March 31, 2004 3:59 PM
Subject: RE: g++ problems
Use g++ not gcc
Gcc is for c and g++ is for c++
Take care,
Sina
No trees were destroyed in sending this message; however, a large number of
electrons were terribly inconvenienced.
-----Original Message
^ permalink raw reply [flat|nested] 24+ messages in thread
* RE: g++ problems
` Kyrath. (AKA Rob)
@ ` Sina Bahram
` Effortless Union with the Divine
` Chuck Hallenbeck
` Tom and Esther Ward
2 siblings, 1 reply; 24+ messages in thread
From: Sina Bahram @ UTC (permalink / raw)
To: 'Speakup is a screen review system for Linux.'
Yes, I thought this too; however, g++ is the command to invoke.
Take care,
Sina
No trees were destroyed in sending this message; however, a large number of
electrons were terribly inconvenienced.
-----Original Message-----
From: speakup-bounces@braille.uwo.ca [mailto:speakup-bounces@braille.uwo.ca]
On Behalf Of Kyrath. (AKA Rob)
Sent: Wednesday, March 31, 2004 4:06 PM
To: Speakup is a screen review system for Linux.
Subject: Re: g++ problems
Been there, done that, same result.
Besides, I thought that I had read that gcc was used with a few different
languages. *shrug* Don't c++ compilers, by default, compile c code? C++ is
a superset of C, right?
-- Rob
----- Original Message -----
From: "Sina Bahram" <sbahram@nc.rr.com>
To: "'Speakup is a screen review system for Linux.'"
<speakup@braille.uwo.ca>
Sent: Wednesday, March 31, 2004 3:59 PM
Subject: RE: g++ problems
Use g++ not gcc
Gcc is for c and g++ is for c++
Take care,
Sina
No trees were destroyed in sending this message; however, a large number of
electrons were terribly inconvenienced.
-----Original Message
_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Kyrath. (AKA Rob)
` Sina Bahram
@ ` Chuck Hallenbeck
` Luke Davis
` Tom and Esther Ward
2 siblings, 1 reply; 24+ messages in thread
From: Chuck Hallenbeck @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
In addition to using g++ instead of gcc, you must be sure your
source file has the .cpp extension, and not simply .c
g++ and gcc are symbolic links to the same compiler. Depending on
which name you use to invoke it, different starting assumptions
are made, different header files expected, different libraries
used, etc.
Chuck
On Wed, 31 Mar 2004, Kyrath. (AKA Rob) wrote:
> Been there, done that, same result.
> Besides, I thought that I had read that gcc was used with a few different
> languages. *shrug*
> Don't c++ compilers, by default, compile c code? C++ is a superset of C,
> right?
> -- Rob
> ----- Original Message -----
> From: "Sina Bahram" <sbahram@nc.rr.com>
> To: "'Speakup is a screen review system for Linux.'"
> <speakup@braille.uwo.ca>
> Sent: Wednesday, March 31, 2004 3:59 PM
> Subject: RE: g++ problems
>
>
> Use g++ not gcc
>
> Gcc is for c and g++ is for c++
>
> Take care,
> Sina
>
> No trees were destroyed in sending this message; however, a large number of
> electrons were terribly inconvenienced.
>
> -----Original Message
>
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
- --
The Moon is Waxing Gibbous (77% of Full)
In a world without Fences or Walls no one needs Windows or Gates.
My home page is now at http://www.mhcable.com/~chuckh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5rc1 (GNU/Linux)
iQCVAwUBQGtHazVdG8M9x9tGAQKa/wQAlhvEHn5PNKHPrBY4wi3CEzvmTAIMQpEo
6Pa5/2Gt2CmhqNL58Oj2kuL1CczF5j6SKTk3kHXWC30pddVgMUgPaKeiobBgn3pl
XVsLwj+XjDS8MVZUWiXgY5Gtz9a+FcOTQRNTsxz8b+0JsbC0pQM/9fM31CN91ej8
Z8Q2X/tBHkk=
=FhCQ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Sina Bahram
@ ` Effortless Union with the Divine
0 siblings, 0 replies; 24+ messages in thread
From: Effortless Union with the Divine @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Don't confuse this poor guy! gcc - the GNU C compiler, compiles
standard C code for the commandline. On this system anyway, man gcc and
man g++ pull up the same entry. gcc most certainly works for a simple
hello world program. It looks like it didn't do a complete install or
something, that it can't find some core files. Not sure about slackware,
but praise "Bob"!
#include <stdio.h>
int main()
{
puts("Hello, world.\n");
}
hey, you can redirect the errors. try:
gcc hello.c -o hello 2> errors.txt
the 2> (the number two then a greaterthan sign) means to redirect
standard error to a file. Then you can look at, or send us, the file.
--
Currently playing: The Orb - Primal Scream / Higher Than The Sun (Higher than the Kite mix)
Good Vibes Radio: http://clearwhitelight.org/goodvibes
Omeron - Effortless Union with the Divine
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
g++ problems Kyrath. (AKA Rob)
` Sina Bahram
@ ` Tom and Esther Ward
` Sean McMahon
` Sean McMahon
` Luke Davis
2 siblings, 2 replies; 24+ messages in thread
From: Tom and Esther Ward @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Hi, my answers are below nested in the body of your message.
----- Original Message -----
From: "Kyrath. (AKA Rob)" <kyrath@cox.net>
To: "Speakup" <speakup@braille.uwo.ca>
Sent: Wednesday, March 31, 2004 3:44 PM
Subject: g++ problems
Hi,
A few of you have been trying to help me get going with compiling C++ code,
but so far there's been no joy.
The messages I'm getting are scrolling off the screen, but quite a few of
them refer to:
/usr/include/c++/3.2.3/i486-slackware-linux/bits/gthr-default.h
I have never seen this error in gcc/g++, and I can only think of two
possibilities. One, the wrong arguments were passed to g++. Second, this was
a bad installation of gcc/g++.
Is there something that needs to be done to gcc before it becomes fully
operational?
No, gcc and g++ should work fine right after the initial installation.
Here's a copy of the code I last tried to compile:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
return 0;
}
Your code looks fine so far.
Also, I was informed by a few of you that the modern C++ uses "iostream"
with a "using namespace std;" instead of the "iostream.h" for the include.
Does this mean that gcc is not backward compatible and will not compile
older source code without modifications?
Gcc in most cases is backward compatible with older code, but it will send
several warning messages that the code is deprecated and needs to be
updated.
The warnings are usually harmless in nature, but are quite annoying, and as
a new programmer it is best to use the new standards and not start with
deprecated material.
Thanks
-- Rob
_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Kyrath. (AKA Rob)
` Sina Bahram
` Chuck Hallenbeck
@ ` Tom and Esther Ward
2 siblings, 0 replies; 24+ messages in thread
From: Tom and Esther Ward @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Hi, Rob.
Wel, c++ compilers can compile c code, but a c compiler can not compile c++
code. So in this context g++ can compile both c and c++ source, but gcc can
only compile c code only.
It is true that c++ is derived mostly from c, but there are several
differences in programming methodology and design, different headers, etc...
Some might argue that a class is nothing more than a glorified struct, but
you can do much more with classes above and beyond a struct which gets in
to the relm of oop design like encapsulation, pollimorphism, etc...
In C++ everything is centered around objects and classes, which once you
adopt the oop design moddle it is hard to go back to plane old C.
Especially, since languages such as java, c++, and VB .net, and others have
adopted the oop design moddle.
----- Original Message -----
From: "Kyrath. (AKA Rob)" <kyrath@cox.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Wednesday, March 31, 2004 4:05 PM
Subject: Re: g++ problems
> Been there, done that, same result.
> Besides, I thought that I had read that gcc was used with a few different
> languages. *shrug*
> Don't c++ compilers, by default, compile c code? C++ is a superset of C,
> right?
> -- Rob
> ----- Original Message -----
> From: "Sina Bahram" <sbahram@nc.rr.com>
> To: "'Speakup is a screen review system for Linux.'"
> <speakup@braille.uwo.ca>
> Sent: Wednesday, March 31, 2004 3:59 PM
> Subject: RE: g++ problems
>
>
> Use g++ not gcc
>
> Gcc is for c and g++ is for c++
>
> Take care,
> Sina
>
> No trees were destroyed in sending this message; however, a large number
of
> electrons were terribly inconvenienced.
>
> -----Original Message
>
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Tom and Esther Ward
@ ` Sean McMahon
` Gregory Nowak
` Luke Davis
` Sean McMahon
1 sibling, 2 replies; 24+ messages in thread
From: Sean McMahon @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Maybe I no nothing here but for such a simple program why don't you use the
stdio.h with a printf statement. and why not just make main void?
----- Original Message -----
From: "Tom and Esther Ward" <tward1978@earthlink.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Wednesday, March 31, 2004 11:50 PM
Subject: Re: g++ problems
> Hi, my answers are below nested in the body of your message.
>
> ----- Original Message -----
> From: "Kyrath. (AKA Rob)" <kyrath@cox.net>
> To: "Speakup" <speakup@braille.uwo.ca>
> Sent: Wednesday, March 31, 2004 3:44 PM
> Subject: g++ problems
>
>
> Hi,
>
> A few of you have been trying to help me get going with compiling C++ code,
> but so far there's been no joy.
>
> The messages I'm getting are scrolling off the screen, but quite a few of
> them refer to:
> /usr/include/c++/3.2.3/i486-slackware-linux/bits/gthr-default.h
>
> I have never seen this error in gcc/g++, and I can only think of two
> possibilities. One, the wrong arguments were passed to g++. Second, this was
> a bad installation of gcc/g++.
>
> Is there something that needs to be done to gcc before it becomes fully
> operational?
>
> No, gcc and g++ should work fine right after the initial installation.
>
> Here's a copy of the code I last tried to compile:
>
> #include <iostream>
> using namespace std;
>
> int main()
> {
> cout << "Hello World!\n";
> return 0;
> }
>
> Your code looks fine so far.
>
> Also, I was informed by a few of you that the modern C++ uses "iostream"
> with a "using namespace std;" instead of the "iostream.h" for the include.
> Does this mean that gcc is not backward compatible and will not compile
> older source code without modifications?
>
> Gcc in most cases is backward compatible with older code, but it will send
> several warning messages that the code is deprecated and needs to be
> updated.
> The warnings are usually harmless in nature, but are quite annoying, and as
> a new programmer it is best to use the new standards and not start with
> deprecated material.
>
> Thanks
> -- Rob
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Tom and Esther Ward
` Sean McMahon
@ ` Sean McMahon
` Gregory Nowak
` (2 more replies)
1 sibling, 3 replies; 24+ messages in thread
From: Sean McMahon @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Another thing, doesn't return take an argument, return (0);
----- Original Message -----
From: "Tom and Esther Ward" <tward1978@earthlink.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Wednesday, March 31, 2004 11:50 PM
Subject: Re: g++ problems
> Hi, my answers are below nested in the body of your message.
>
> ----- Original Message -----
> From: "Kyrath. (AKA Rob)" <kyrath@cox.net>
> To: "Speakup" <speakup@braille.uwo.ca>
> Sent: Wednesday, March 31, 2004 3:44 PM
> Subject: g++ problems
>
>
> Hi,
>
> A few of you have been trying to help me get going with compiling C++ code,
> but so far there's been no joy.
>
> The messages I'm getting are scrolling off the screen, but quite a few of
> them refer to:
> /usr/include/c++/3.2.3/i486-slackware-linux/bits/gthr-default.h
>
> I have never seen this error in gcc/g++, and I can only think of two
> possibilities. One, the wrong arguments were passed to g++. Second, this was
> a bad installation of gcc/g++.
>
> Is there something that needs to be done to gcc before it becomes fully
> operational?
>
> No, gcc and g++ should work fine right after the initial installation.
>
> Here's a copy of the code I last tried to compile:
>
> #include <iostream>
> using namespace std;
>
> int main()
> {
> cout << "Hello World!\n";
> return 0;
> }
>
> Your code looks fine so far.
>
> Also, I was informed by a few of you that the modern C++ uses "iostream"
> with a "using namespace std;" instead of the "iostream.h" for the include.
> Does this mean that gcc is not backward compatible and will not compile
> older source code without modifications?
>
> Gcc in most cases is backward compatible with older code, but it will send
> several warning messages that the code is deprecated and needs to be
> updated.
> The warnings are usually harmless in nature, but are quite annoying, and as
> a new programmer it is best to use the new standards and not start with
> deprecated material.
>
> Thanks
> -- Rob
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Sean McMahon
@ ` Gregory Nowak
` Luke Davis
1 sibling, 0 replies; 24+ messages in thread
From: Gregory Nowak @ UTC (permalink / raw)
To: Sean McMahon, Speakup is a screen review system for Linux.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Because then he'd be writing in C, not in C++.
Greg
On Thu, Apr 01, 2004 at 09:51:06AM -0700, Sean McMahon wrote:
> Maybe I no nothing here but for such a simple program why don't you use the
> stdio.h with a printf statement. and why not just make main void?
- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAbGTo7s9z/XlyUyARAkSHAJoDpEpszbUGHkYOXxe8bsGbZ2fnrACglcMU
Al0z8xSU5ybSqBuv2aJXmYc=
=GLcJ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Sean McMahon
@ ` Gregory Nowak
` Luke Davis
` Tom and Esther Ward
2 siblings, 0 replies; 24+ messages in thread
From: Gregory Nowak @ UTC (permalink / raw)
To: Sean McMahon, Speakup is a screen review system for Linux.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yes, and if you would have taken a careful look at his code, which you
apparently didn't do, you would have seen that this is exactly the
line he has.
Greg
On Thu, Apr 01, 2004 at 09:52:41AM -0700, Sean McMahon wrote:
> Another thing, doesn't return take an argument, return (0);
>
- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAbGVT7s9z/XlyUyARAo3KAKC6nWqdaoFJRRZKtLd6y9W62I4LsQCgqJ37
grTd1Va+Hdo5y46gbFnJeVA=
=HYRO
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Sean McMahon
` Gregory Nowak
@ ` Luke Davis
1 sibling, 0 replies; 24+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Sean McMahon, Speakup is a screen review system for Linux.
On Thu, 1 Apr 2004, Sean McMahon wrote:
> Maybe I no nothing here but for such a simple program why don't you use the
> stdio.h with a printf statement. and why not just make main void?
He could do the former, in order to test the compiler, but since it is C,
and not C++, it would not be of much use, other than experience.
As to the second point: that is invalid code. Yes, it works, but it
shouldn't. Main is supposed to return an int.
Luke
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Sean McMahon
` Gregory Nowak
@ ` Luke Davis
` Tom and Esther Ward
2 siblings, 0 replies; 24+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Sean McMahon, Speakup is a screen review system for Linux.
On Thu, 1 Apr 2004, Sean McMahon wrote:
> Another thing, doesn't return take an argument, return (0);
Indeed it does. Here is his code, as it appeared in your quoted message.
It is correct.
> > #include <iostream>
> > using namespace std;
> >
> > int main()
> > {
> > cout << "Hello World!\n";
> > return 0;
> > }
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
g++ problems Kyrath. (AKA Rob)
` Sina Bahram
` Tom and Esther Ward
@ ` Luke Davis
2 siblings, 0 replies; 24+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
To capture the messages from your g++, run it as follows:
g++ file.c -o file 2>&1 > errors.lst
Then, do a more on errors.lst, and you should see everything.
You could also just pipe directly to more.
On Wed, 31 Mar 2004, Kyrath. (AKA Rob) wrote:
> Hi,
>
> A few of you have been trying to help me get going with compiling C++ code, but so far there's been no joy.
>
> The messages I'm getting are scrolling off the screen, but quite a few of them refer to:
> /usr/include/c++/3.2.3/i486-slackware-linux/bits/gthr-default.h
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Chuck Hallenbeck
@ ` Luke Davis
` Chuck Hallenbeck
` Tom and Esther Ward
0 siblings, 2 replies; 24+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
On Wed, 31 Mar 2004, Chuck Hallenbeck wrote:
> In addition to using g++ instead of gcc, you must be sure your
> source file has the .cpp extension, and not simply .c
Where is that documented? I use ".c" extensions on C++ files all of the
time, to no bad effect.
Luke
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Sean McMahon
` Gregory Nowak
` Luke Davis
@ ` Tom and Esther Ward
2 siblings, 0 replies; 24+ messages in thread
From: Tom and Esther Ward @ UTC (permalink / raw)
To: Sean McMahon, Speakup is a screen review system for Linux.
Yes, when you have functions of type int, double, etc they will return some
sort of value. Usually, you would return something useful like a calculation
or pull something from a class, but when nothing is to be returned then it
must return 0.
----- Original Message -----
From: "Sean McMahon" <smcmahon@usgs.gov>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Thursday, April 01, 2004 11:52 AM
Subject: Re: g++ problems
> Another thing, doesn't return take an argument, return (0);
>
> ----- Original Message -----
> From: "Tom and Esther Ward" <tward1978@earthlink.net>
> To: "Speakup is a screen review system for Linux."
<speakup@braille.uwo.ca>
> Sent: Wednesday, March 31, 2004 11:50 PM
> Subject: Re: g++ problems
>
>
> > Hi, my answers are below nested in the body of your message.
> >
> > ----- Original Message -----
> > From: "Kyrath. (AKA Rob)" <kyrath@cox.net>
> > To: "Speakup" <speakup@braille.uwo.ca>
> > Sent: Wednesday, March 31, 2004 3:44 PM
> > Subject: g++ problems
> >
> >
> > Hi,
> >
> > A few of you have been trying to help me get going with compiling C++
code,
> > but so far there's been no joy.
> >
> > The messages I'm getting are scrolling off the screen, but quite a few
of
> > them refer to:
> > /usr/include/c++/3.2.3/i486-slackware-linux/bits/gthr-default.h
> >
> > I have never seen this error in gcc/g++, and I can only think of two
> > possibilities. One, the wrong arguments were passed to g++. Second, this
was
> > a bad installation of gcc/g++.
> >
> > Is there something that needs to be done to gcc before it becomes fully
> > operational?
> >
> > No, gcc and g++ should work fine right after the initial installation.
> >
> > Here's a copy of the code I last tried to compile:
> >
> > #include <iostream>
> > using namespace std;
> >
> > int main()
> > {
> > cout << "Hello World!\n";
> > return 0;
> > }
> >
> > Your code looks fine so far.
> >
> > Also, I was informed by a few of you that the modern C++ uses "iostream"
> > with a "using namespace std;" instead of the "iostream.h" for the
include.
> > Does this mean that gcc is not backward compatible and will not compile
> > older source code without modifications?
> >
> > Gcc in most cases is backward compatible with older code, but it will
send
> > several warning messages that the code is deprecated and needs to be
> > updated.
> > The warnings are usually harmless in nature, but are quite annoying, and
as
> > a new programmer it is best to use the new standards and not start with
> > deprecated material.
> >
> > Thanks
> > -- Rob
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Luke Davis
@ ` Chuck Hallenbeck
` Luke Davis
` Tom and Esther Ward
1 sibling, 1 reply; 24+ messages in thread
From: Chuck Hallenbeck @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The GCC man page describes the various input file suffixes and
their meanings.
On Thu, 1 Apr 2004, Luke Davis wrote:
> On Wed, 31 Mar 2004, Chuck Hallenbeck wrote:
>
> > In addition to using g++ instead of gcc, you must be sure your
> > source file has the .cpp extension, and not simply .c
>
> Where is that documented? I use ".c" extensions on C++ files all of the
> time, to no bad effect.
>
> Luke
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
- --
The Moon is Waxing Gibbous (85% of Full)
In a world without Fences or Walls no one needs Windows or Gates.
My home page is now at http://www.mhcable.com/~chuckh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iQCVAwUBQGyD5TVdG8M9x9tGAQJkAAQAwkmxu1b4l08+IrP51ClNz5mf0/rhRQwn
0OxKfYaR6ohvrMbCIer8a3zB2twhrJfIq7bG7T7aK4BOK0d3GDTcCjpehvSg9RJ5
DG4PA16oec/zc5/baWYDR31hXAjp41GP1JxpzVD2QKglD4RYRdM07sFl+Ie2YGNN
d0moyEscHd4=
=3s2Q
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Luke Davis
` Chuck Hallenbeck
@ ` Tom and Esther Ward
` Chuck Hallenbeck
` Sean McMahon
1 sibling, 2 replies; 24+ messages in thread
From: Tom and Esther Ward @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Actually, I don't think g++ cares about the file extention as I have used
cxx, cpp, cc, and it compiled them just the same.
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Thursday, April 01, 2004 3:31 PM
Subject: Re: g++ problems
> On Wed, 31 Mar 2004, Chuck Hallenbeck wrote:
>
> > In addition to using g++ instead of gcc, you must be sure your
> > source file has the .cpp extension, and not simply .c
>
> Where is that documented? I use ".c" extensions on C++ files all of the
> time, to no bad effect.
>
> Luke
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Tom and Esther Ward
@ ` Chuck Hallenbeck
` Sean McMahon
` Sean McMahon
1 sibling, 1 reply; 24+ messages in thread
From: Chuck Hallenbeck @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 1 Apr 2004, Tom and Esther Ward wrote:
> Actually, I don't think g++ cares about the file extention as I have used
> cxx, cpp, cc, and it compiled them just the same.
Here is what the man page says:
For any given input file, the file name suffix determines
what kind of compilation is done:
file.c
C source code which must be preprocessed.
file.i
C source code which should not be preprocessed.
file.ii
C++ source code which should not be preprocessed.
file.m
Objective-C source code. Note that you must link with
the library libobjc.a to make an Objective-C program
work.
file.mi
Objective-C source code which should not be prepro-
cessed.
file.h
C header file (not to be compiled or linked).
file.cc
file.cp
file.cxx
file.cpp
file.c++
file.C
C++ source code which must be preprocessed. Note that
in .cxx, the last two letters must both be literally
x. Likewise, .C refers to a literal capital C.
file.f
file.for
file.FOR
Fortran source code which should not be preprocessed.
file.F
file.fpp
file.FPP
Fortran source code which must be preprocessed (with
the traditional preprocessor).
file.r
Fortran source code which must be preprocessed with a
RATFOR preprocessor (not included with GCC).
file.ads
Ada source code file which contains a library unit
declaration (a declaration of a package, subprogram,
or generic, or a generic instantiation), or a library
unit renaming declaration (a package, generic, or sub-
program renaming declaration). Such files are also
called specs.
file.adb
Ada source code file containing a library unit body (a
subprogram or package body). Such files are also
called bodies.
file.s
Assembler code.
file.S
Assembler code which must be preprocessed.
other
An object file to be fed straight into linking. Any
file name with no recognized suffix is treated this
way.
You can specify the input language explicitly with the -x
option:
-x language
Specify explicitly the language for the following
input files (rather than letting the compiler choose a
default based on the file name suffix). This option
applies to all following input files until the next -x
option. Possible values for language are:
c c-header cpp-output
c++ c++-cpp-output
objective-c objc-cpp-output
assembler assembler-with-cpp
ada
f77 f77-cpp-input ratfor
java
-x none
Turn off any specification of a language, so that sub-
sequent files are handled according to their file name
suffixes (as they are if -x has not been used at all).
- --
The Moon is Waxing Gibbous (85% of Full)
In a world without Fences or Walls no one needs Windows or Gates.
My home page is now at http://www.mhcable.com/~chuckh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iQCVAwUBQGyH5DVdG8M9x9tGAQIw1wQA4+A5vqOGFqQHiOOV27xYosyhVNGFJ2hw
28KFEbZ2y5y9/b6SdKnyRfiUpGioqgwWps5Dawijxacm8dw7sPrK1PhZB//S0Bfa
XtmBn8kSaDyq+BTzlssqnOn3CvD1NZ/TAOBhTmFm6A3TzP6XuP0RoVoVsHE6NAZ0
W+WANpEfZSY=
=aK/u
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Chuck Hallenbeck
@ ` Luke Davis
` Chuck Hallenbeck
0 siblings, 1 reply; 24+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
On Thu, 1 Apr 2004, Chuck Hallenbeck wrote:
> The GCC man page describes the various input file suffixes and
> their meanings.
You would be talking about this part of the man page?
Suffixes of source file names indicate the language and kind of pro-
cessing to be done:
.c C source; preprocess, compile, assemble
.C C++ source; preprocess, compile, assemble
.cc C++ source; preprocess, compile, assemble
If so, I'm not sure how that supports the statement, that "gcc requires
that C plus plus files should be named with a ".cpp" extension".
Please elaborate.
Luke
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Luke Davis
@ ` Chuck Hallenbeck
0 siblings, 0 replies; 24+ messages in thread
From: Chuck Hallenbeck @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You are right, I overstated my point. The .cpp suffix is one of
several that identify a source file as a c++ program. The
important point is that .c is not one of them.
Sorry for the error. Thomas mentioned several suffixes he uses,
all of which are shown as equivalent in the man page. But .c is
not among them.
There is the option to specify the language in a compiler option
instead of in a file suffix. I wonder if some Makefile's use
this, so it appears not to matter what the suffix is?
On Thu, 1 Apr 2004, Luke Davis wrote:
> On Thu, 1 Apr 2004, Chuck Hallenbeck wrote:
>
> > The GCC man page describes the various input file suffixes and
> > their meanings.
>
> You would be talking about this part of the man page?
>
> Suffixes of source file names indicate the language and kind of pro-
> cessing to be done:
>
> .c C source; preprocess, compile, assemble
> .C C++ source; preprocess, compile, assemble
> .cc C++ source; preprocess, compile, assemble
>
> If so, I'm not sure how that supports the statement, that "gcc requires
> that C plus plus files should be named with a ".cpp" extension".
>
> Please elaborate.
>
> Luke
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
- --
The Moon is Waxing Gibbous (85% of Full)
In a world without Fences or Walls no one needs Windows or Gates.
My home page is now at http://www.mhcable.com/~chuckh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iQCVAwUBQGyOODVdG8M9x9tGAQLmiAP/b3LAIbcC7XP1GcWaUi8cElrMfpZcp+Gb
p8TIZ59Ijqkjx0sSnceff7BNe/ztzZPMnDEsl9OvpXBP2QcCvr/L6eG0lV0Imm+w
ihz9DNqtqGR4xFpCzE26QYkbSetLlUsXECzFN+hVjGGtGZjOxsjgZX0+baIe0tQy
yU66ygYdHog=
=NNbP
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Tom and Esther Ward
` Chuck Hallenbeck
@ ` Sean McMahon
1 sibling, 0 replies; 24+ messages in thread
From: Sean McMahon @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
in automake for example you can define the suffixes so this may be more
convention than necessary.
----- Original Message -----
From: "Tom and Esther Ward" <tward1978@earthlink.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Thursday, April 01, 2004 2:17 PM
Subject: Re: g++ problems
> Actually, I don't think g++ cares about the file extention as I have used
> cxx, cpp, cc, and it compiled them just the same.
>
> ----- Original Message -----
> From: "Luke Davis" <ldavis@shellworld.net>
> To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
> Sent: Thursday, April 01, 2004 3:31 PM
> Subject: Re: g++ problems
>
>
> > On Wed, 31 Mar 2004, Chuck Hallenbeck wrote:
> >
> > > In addition to using g++ instead of gcc, you must be sure your
> > > source file has the .cpp extension, and not simply .c
> >
> > Where is that documented? I use ".c" extensions on C++ files all of the
> > time, to no bad effect.
> >
> > Luke
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: g++ problems
` Chuck Hallenbeck
@ ` Sean McMahon
0 siblings, 0 replies; 24+ messages in thread
From: Sean McMahon @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Is a c++ gui more accessable then a java gui. What I mean is it easier to make
c++ guis accessable? Sean
----- Original Message -----
From: "Chuck Hallenbeck" <chuckh@sent.com>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Thursday, April 01, 2004 2:21 PM
Subject: Re: g++ problems
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 1 Apr 2004, Tom and Esther Ward wrote:
>
> > Actually, I don't think g++ cares about the file extention as I have used
> > cxx, cpp, cc, and it compiled them just the same.
>
>
> Here is what the man page says:
>
> For any given input file, the file name suffix determines
> what kind of compilation is done:
>
> file.c
> C source code which must be preprocessed.
>
> file.i
> C source code which should not be preprocessed.
>
> file.ii
> C++ source code which should not be preprocessed.
>
> file.m
> Objective-C source code. Note that you must link with
> the library libobjc.a to make an Objective-C program
> work.
>
> file.mi
> Objective-C source code which should not be prepro-
> cessed.
>
> file.h
> C header file (not to be compiled or linked).
>
> file.cc
> file.cp
> file.cxx
> file.cpp
> file.c++
> file.C
> C++ source code which must be preprocessed. Note that
> in .cxx, the last two letters must both be literally
> x. Likewise, .C refers to a literal capital C.
>
> file.f
> file.for
> file.FOR
> Fortran source code which should not be preprocessed.
>
> file.F
> file.fpp
> file.FPP
> Fortran source code which must be preprocessed (with
> the traditional preprocessor).
>
> file.r
> Fortran source code which must be preprocessed with a
> RATFOR preprocessor (not included with GCC).
> file.ads
> Ada source code file which contains a library unit
> declaration (a declaration of a package, subprogram,
> or generic, or a generic instantiation), or a library
> unit renaming declaration (a package, generic, or sub-
> program renaming declaration). Such files are also
> called specs.
>
> file.adb
> Ada source code file containing a library unit body (a
> subprogram or package body). Such files are also
> called bodies.
>
> file.s
> Assembler code.
>
> file.S
> Assembler code which must be preprocessed.
>
> other
> An object file to be fed straight into linking. Any
> file name with no recognized suffix is treated this
> way.
>
> You can specify the input language explicitly with the -x
> option:
>
> -x language
> Specify explicitly the language for the following
> input files (rather than letting the compiler choose a
> default based on the file name suffix). This option
> applies to all following input files until the next -x
> option. Possible values for language are:
>
> c c-header cpp-output
> c++ c++-cpp-output
> objective-c objc-cpp-output
> assembler assembler-with-cpp
> ada
> f77 f77-cpp-input ratfor
> java
>
>
> -x none
> Turn off any specification of a language, so that sub-
> sequent files are handled according to their file name
> suffixes (as they are if -x has not been used at all).
>
>
>
> - --
> The Moon is Waxing Gibbous (85% of Full)
> In a world without Fences or Walls no one needs Windows or Gates.
> My home page is now at http://www.mhcable.com/~chuckh
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iQCVAwUBQGyH5DVdG8M9x9tGAQIw1wQA4+A5vqOGFqQHiOOV27xYosyhVNGFJ2hw
> 28KFEbZ2y5y9/b6SdKnyRfiUpGioqgwWps5Dawijxacm8dw7sPrK1PhZB//S0Bfa
> XtmBn8kSaDyq+BTzlssqnOn3CvD1NZ/TAOBhTmFm6A3TzP6XuP0RoVoVsHE6NAZ0
> W+WANpEfZSY=
> =aK/u
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~ UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
g++ problems Kyrath. (AKA Rob)
` Sina Bahram
` Kyrath. (AKA Rob)
` Sina Bahram
` Effortless Union with the Divine
` Chuck Hallenbeck
` Luke Davis
` Chuck Hallenbeck
` Luke Davis
` Chuck Hallenbeck
` Tom and Esther Ward
` Chuck Hallenbeck
` Sean McMahon
` Sean McMahon
` Tom and Esther Ward
` Tom and Esther Ward
` Sean McMahon
` Gregory Nowak
` Luke Davis
` Sean McMahon
` Gregory Nowak
` Luke Davis
` Tom and Esther Ward
` Luke Davis
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).