LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Unable to compile C++ programs.make:g++ command not found error.Error 127 (http://www.linuxquestions.org/questions/programming-9/unable-to-compile-c-programs-make-g-command-not-found-error-error-127-a-711703/)

PrathuD 03-15-2009 04:37 AM

Unable to compile C++ programs.make:g++ command not found error.Error 127
 
Hello friends,I work on Fedora 9 and I'm unable to compile my c++ program using the make in the terminal as well as in the IDE-Anjuta.
although 'make' works fine with C programs,I get an error that g++ command is not found whenever I try it with C++ programs.

Code:

[prathamesh@localhost dsl]$ make ass7_2222
g++    ass7_2222.cpp  -o ass7_2222
make: g++: Command not found
make: *** [ass7_2222] Error 127

[prathamesh@localhost ~]$ cd ~/Documents/My_Programs/SE-4/dsl
[prathamesh@localhost dsl]$ g++ ass7_2222.cpp -o ass7_2222
bash: g++: command not found

I have the latest version of make installed on my computer.
Code:

[root@localhost ~]# yum install make
Loaded plugins: refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 11178.
Another app is currently holding the yum lock; waiting for it to exit...
Setting up Install Process
Parsing package install arguments
Package 1:make-3.81-12.fc9.i386 already installed and latest version
Nothing to do

I,then reinstalled make.
Still I'm unable to compile C++ programs..
Would anyone please help me out???Please..

Sergei Steshenko 03-15-2009 05:20 AM

'gcc' is not the same as 'g++', and the error message clearly says:

Quote:

bash: g++: command not found
So, either g++ is not installed or it's not in $PATH.

knudfl 03-15-2009 06:48 AM

  • # yum -y install gcc-c++
will provide /usr/bin/g++


.....

PrathuD 03-16-2009 12:44 PM

@knudfl
thanx..It worked..
I had 'make' installed...I assumed that it would come along with g++.The man pages certainly had many entries on g++.
Thanx..


All times are GMT -5. The time now is 10:50 PM.