Problem with "make" command in Linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with "make" command in Linux
# 1  
Old 07-24-2013
Problem with "make" command in Linux

Hi all,
I downloaded an external program and extracted all the files to a folder. they have a make file which I have to run. But when I run make file I get an error
Code:
g++  -O2 -c pgm.cpp 
make: g++: Command not found
make: *** [pgm.o] Error 127

When I checked the list of GCC I get this
Code:
binf-01 (kmohanas) 1002 $yum list gcc*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.as24220.net
 * extras: ftp.swin.edu.au
 * updates: mirror.as24220.net
Installed Packages
gcc.x86_64                               4.4.7-3.el6                       @base
gcc-gfortran.x86_64                      4.4.7-3.el6                       @base
Available Packages
gcc-c++.x86_64                           4.4.7-3.el6                       base 
gcc-gnat.x86_64                          4.4.7-3.el6                       base 
gcc-java.x86_64                          4.4.7-3.el6                       base 
gcc-objc.x86_64                          4.4.7-3.el6                       base 
gcc-objc++.x86_64                        4.4.7-3.el6                       base

Could anyone please tell me what the error is and what exactly I have to do. I have no clue about this. Any help is very much appreciated.

Thanks
Kaavya
# 2  
Old 07-24-2013
You are missing g++, see if you have gcc-c++ package installed and if not, install that.
# 3  
Old 07-24-2013
Hi Mr.Bean,
When I tried installing it, I get a message like this
Code:
sbinf-01 (kmohanas) 1014 $su root yum install gcc-c++
Password: 
yum: line 1: fg: no job control
yum: line 2: syntax error near unexpected token `ImageMagick'
yum: line 2: `%%Creator: (ImageMagick)'

# 4  
Old 07-24-2013
rather than doing everything with just 1 command, try to su root first, enter password and then yum install gcc-c++
# 5  
Old 07-24-2013
Hi Mr.Bean ,
Thank you so much. I could install the g++ library now. However when I run make file of the program I downloaded, I get something like this,
Code:
sbinf-01 (kmohanas) 211 $make
g++  -O2 -c pgm.cpp 
In file included from pgm.cpp:12:
pgm.h:16:49: error: iostream.h: No such file or directory
pgm.h:17:51: error: fstream.h: No such file or directory
pgm.h:18:36: error: iomanip.h: No such file or directory
pgm.cpp: In function ‘int main(int, char**)':
pgm.cpp:31: error: ‘cout' was not declared in this scope
pgm.cpp:31: error: ‘endl' was not declared in this scope
pgm.cpp:41: warning: deprecated conversion from string constant to ‘char*'
pgm.cpp:138: error: ‘cerr' was not declared in this scope
pgm.cpp:152: warning: deprecated conversion from string constant to ‘char*'
pgm.cpp:158: warning: deprecated conversion from string constant to ‘char*'
pgm.cpp:161: warning: deprecated conversion from string constant to ‘char*'
pgm.cpp:164: warning: deprecated conversion from string constant to ‘char*'
pgm.cpp:173: warning: deprecated conversion from string constant to ‘char*'
make: *** [pgm.o] Error 1

Could please tell me what is happening exactly
# 6  
Old 07-24-2013
You'll need libstdc++-devel very likely
# 7  
Old 07-24-2013
Hi Mr.Bean,
I think it is already installed as when I checked it said,
Code:
sbinf-01 (kmohanas) 207 $yum install libstdc++-devel*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.as24220.net
 * extras: mirror.internode.on.net
 * updates: mirror.as24220.net
Setting up Install Process
Package libstdc++-devel-4.4.7-3.el6.x86_64 already installed and latest version
Nothing to do

What do you rekon the problem might be?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

2. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

Make scipt except from "Y","y" and "yes" to take [Enter] as being "yes"

This is the script: #!/bin/sh if ; then rm -rf /usr/share/WallpaperChanger; fi if ; then rm -rf /usr/bin/wallch; fi; if ; then rm -rf /usr/share/applications/wallch.desktop; fi if ; then rm -rf /usr/share/doc/wallch; fi if ; then rm -rf /usr/share/man/man1/wallch.1.gz; fi echo "Delete... (4 Replies)
Discussion started by: hakermania
4 Replies

5. Programming

compile fails in linux ... "No rule to make target" ... HELP

hello all, attached you can find a tool (written in C) that i really need to make it compile under linux i am able to compile and run it successfully in mac os x, but in linux the compilation fails the only thing that i did so far is to change the following #include <sys/malloc.h> to... (13 Replies)
Discussion started by: OneDreamCloser
13 Replies

6. Programming

how could i make a program mixed with many "|", "<" and ">"

I have written following code to do: ls -l | wc -w, it works: but when there are not only a single "|", if there are more such as: ls -l | sort -r | sort | sort -r, This program does not work, i want to know how could i deal with it when there are more "|", another situation is that, if it mixes... (2 Replies)
Discussion started by: strugglingman
2 Replies

7. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies

8. UNIX for Advanced & Expert Users

make problem with "vnc"

i'm starting to think i post too much. alright a new problem... i'm trying to do the "make World" for Xvnc, and i keep running into the following error: # make World Building Release 6.3 of the X Window System. I hope you checked the configuration parameters in ./config/cf to see if... (2 Replies)
Discussion started by: xyyz
2 Replies
Login or Register to Ask a Question