> Ok. I think I've talked about why you are having your problems already.
> I just wanted to add a few things about g++ in general. If you are doing
> this for school, they are probably teaching you ANSI C++. gcc does not
> follow the ANSI standard without you specifically telling it to. If you
> want to make it be as careful as (say Metroworks CodeWarrior(which still
> doesn't understand that MAIN RETURNS INT!), or Borlands compiler), you'll
> need to compile with at least:
>
> g++ -Wall -ansi -pedantic
>
> Which will get gcc pretty darn close to ansi, and I also believe RedHat6.1
> ships with EGCS 1.x.x . You may want to upgrade gcc to 2.95.x as c++ is
> something that is being fairly actively worked on (to my knowledge).
gcc --version shows egcs-2.91.66
I'm not sure of the difference between the two (gcc and egcs). I started reading
something about it yesterday. I think egcs was being merged with gcc??
> > I also tried compiling something I've done before (on another machine)
> > and it returned basically the same errors. So I am thinking it has to do
> > with the install. So I tried installing glibc, glibc-devel, and
> > glibc-profile. I think someone told me these are the C libraries. I also
> > did a 'find iostream' and nothing came up. Math and iostream are the
> > only includes I need in this one. I did find Math.h in
> > /usr/i386-glibc20-linux/include
> >
> > Am I looking in the right direction???
>
> Oh, and on this, no. The errors that you are getting come from the linker.
> Occassionaly you will have a program that won't link right because you forgot
> a header that had a macro that turned some function call like
>
> foo(int a, int b, void *c)
> ^bad example for c++, but works for c
> into
> __foo__P(__int32, char *)
>
> base on what b is or somesuch... and you can't link.
Ok. This is way above my head. I am in beginner C++. I'm kinda following. But not
sure what the header is. I'm thinking that it's everything before the main()
function??
> However if you compile all code -Wall you will get warned (in C at least,
> I very rarely use the c++ compiler any more.) about implicit declarations
> of functions.
What is the purpose of -Wall??? Does this mean that there is no margin for error
in compiling the code??? Like, if it doesn't know exactly what is intended the it
won't continue.
Thanks,
John
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs