Operating System - HP-UX
1837263 Members
2518 Online
110115 Solutions
New Discussion

gcc compiles c but not c++

 
Dave Chamberlin
Trusted Contributor

gcc compiles c but not c++

Hello,

I have downloaded gcc (3.3.1) and installed the depots. Using gcc I can compile c programs but not c++. I get:
/usr/ccs/bin/ld Unsatisfied symbols....
What have I forgotten? Also - can someone tell me how to use gcc instead of aCC? Can I just have a link for aCC that points to gcc?
Thanks

4 REPLIES 4
Umapathy S
Honored Contributor

Re: gcc compiles c but not c++

Dave,
Just having a link will be not going to work, I believe.

For c++ you need to call g++.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Paddy_1
Valued Contributor

Re: gcc compiles c but not c++

I think you compiled it with --with-cxx=aCC option.

Could you please check if you can compile it with aCC?
The sufficiency of my merit is to know that my merit is NOT sufficient
Mark Grant
Honored Contributor

Re: gcc compiles c but not c++

It would be interesting to know which unsatisfied symbols they are. On the other hand, I'm not sure if gcc 3.1 is any better but gcc in general is not a good c++ compiler.
Never preceed any demonstration with anything more predictive than "watch this"
Dave Chamberlin
Trusted Contributor

Re: gcc compiles c but not c++

thanks for the replies.
Paddy - I dont have aCC (which is why I am trying another c++ compiler) so I can't test it.
Mark - Pretty much all the symbols are unresolved - cout etc. I am guessing this is in the linking and not compiling. I did add the gcc-lib path to the LD_LIBRARY_PATH etc.