I ve just installed ubuntu intrepid ibex (8.10.) on my laptop
i have been using it for a while already but i just wanted to clear the system completely so i installed it, put some updates, some programs, but i also installed CodeBlocks using synaptic manager. Everything finished smoothly.
Now, i started the program, typed small program just to check if everything works.
I saved it as HelloCodeBlocks.cpp
Here is the code:

// HelloCodeBlocks.cpp -- First program in CodeBlocks

#include <stdio.h>

int main (void)
{
   printf ("Hello CodeBlocks!\n");

   getch ();
   return 0;
}

but it seems it doesent work.
when i try to compile it (build it) it says this in build log:

Compiling: /home/basta/Programs/HelloCodeBlocks.cpp
/bin/sh: g++: not found
Process terminated with status 127 (0 minutes, 0 seconds)
0 errors, 0 warnings

it seems to me that it is trying to use g++ as compiler although it said that gcc is the default one (and i have it on my machine - installed it using synaptic manager)
i tried to change default "c++ compiler" from g++ to gcc and the same thing for "linker for dynamic libs" and than it says:

Compiling: /home/basta/Programs/HelloCodeBlocks.cpp
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

any suggestions? is there anything i had to configure before first run? thanks in advance

Recommended Answers

All 2 Replies

You have gcc (The C compiler) installed, but not g++ (The C++ compiler). cc1plus is the binary you need, but it comes bundled with g++ (not gcc). Look for build-essential, or at a prompt apt-get install build-essential. Possibly you might just do apt-get install g++, but I think build-essential has more tools.

commented: Quick&precise problem allocation +1

thank you....i first did
sudo apt-get install c++, becuse i already had newest version of gcc, but as many suggested i also did sudo atp-get install build-esential...
work perfectly...
again...thank you very much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.