LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-30-2006, 05:11 PM   #1
briemac
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Rep: Reputation: 0
bash: g++ command not found


I am having trouble compiling my .cpp files. When I try using g++, I am told the the command is not found. I am running the latest version of Ubuntu and am new to the Linux OS. I know that gcc is installed because when I type that in I get no input, and when I type "gcc helloWorld.cpp -o Hello" (for example, and yes, the file exists in my current directory), it states
"error trying to exec 'cclplus':execvp:no such file or directory"
and I do not know what this means. Other things I have tried replacing g++ with are: gcc-c++, gcc-cpp, and gcc-4.1. Does anyone know what else I can do?
 
Old 12-30-2006, 05:12 PM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,008

Rep: Reputation: 110Reputation: 110
It most likely means you don't have it installed, but I can't really tell.
 
Old 12-30-2006, 05:23 PM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Hmm....what's the result if you type "which g++"?
 
Old 12-30-2006, 05:27 PM   #4
briemac
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Original Poster
Rep: Reputation: 0
tuxdev,
I installed Linux on my machine about a month ago for my programming class, and g++ worked at the time. I haven't changed anything since then as I recall (besides installing MATLAB).
indienick,
you really want me to type "which g++" ?? what does this do?
 
Old 12-30-2006, 05:40 PM   #5
briemac
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Original Poster
Rep: Reputation: 0
ok so I typed in "which g++" and I'm not sure what exactly happened, another command line just appeared. It did not tell me where my compiler resides. Is that what was supposed to happen?
 
Old 12-30-2006, 05:52 PM   #6
briemac
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Original Poster
Rep: Reputation: 0
ok and now i tried typing in "type g++" and it said command does not exist or something of the sorts, but I am not exactly sure what the "type" command does...
 
Old 12-30-2006, 06:33 PM   #7
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Hmm...very odd indeed. If which didn't give you an error saying it couldn't find it, but gave you nothing back, it may suggest a possible corrupt or butchered install.

Try going into synaptic (or whichever GUI package manager Ubuntu uses), and search for "g++" or the package which the GCC and G++ compilers are provided with.
 
Old 12-30-2006, 06:39 PM   #8
briemac
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Original Poster
Rep: Reputation: 0
yeah, sorry I'm new at this ... like a complete newbie and basically have no idea what you just said. How do I go into synaptic?
 
Old 12-30-2006, 06:54 PM   #9
namit
Member
 
Registered: Aug 2005
Distribution: Debian
Posts: 355

Rep: Reputation: 30
sudo apt-get install cpp gcc

Last edited by namit; 12-30-2006 at 06:55 PM.
 
Old 12-30-2006, 07:02 PM   #10
briemac
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Original Poster
Rep: Reputation: 0
um...what? sorry...
 
Old 12-30-2006, 07:04 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,806

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
Seems you need to spend some time reading some doco - on the ubuntu wiki there is several good articles, amongst them a synaptic howto, and a compiling guide.

I think you'll need build-essentials on a Debian based distro - see the guide above for details.
 
Old 12-30-2006, 08:28 PM   #12
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
What namit is suggesting is you open a command shell, and type that in.
 
Old 12-30-2006, 08:56 PM   #13
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
On SuSE, g++ is supplied by a different package than cpp. ( gcc-c++ ). On others the package name may be named different. You should take the error message at its word and install the package that supplies g++.
 
Old 12-30-2006, 09:07 PM   #14
briemac
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Original Poster
Rep: Reputation: 0
thanks guys, I feel like a royal git now. I'll try that as soon as I figure out how to get wireless connection ha ha. My drivers are already recognized, I just don't know how to get onto a secure network with linux...
 
Old 12-31-2006, 01:31 AM   #15
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
The programming forum wouldn't be the correct forum for your wireless problem, so you probably could post to the networking/wireless forum. However, add your distro and version to your user profile to make it easier getting the right advice. For example, some systems will have a gui config program that you can use that will end up writing to /etc/sysconfig/network/ifcfg-<device> or some other configuration file. Others will have a script somewhere else where it is configured. SuSE will take the information from ifcfg-wlan0 file, for example and create a wpa_supplicant.conf file on the fly, while other distros will read your /etc/wpa_supplicant.conf file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: command not found! Adil_uk Linux - General 14 04-09-2012 01:04 AM
bash: command not found hamish Linux - Newbie 7 02-23-2011 04:28 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
-bash: cp: command not found johnlittlepeap Fedora 2 11-15-2004 08:52 AM
bash: ll: command not found x2000koh Linux - Newbie 3 08-08-2003 05:11 AM


All times are GMT -5. The time now is 01:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration