PDA

View Full Version : [ubuntu] [SOLVED] Netbeans- Programming in C++



nayeret43
January 3rd, 2009, 07:41 PM
Ok, so I have this problem with Netbeans IDE 6.1

Every time I try to run a C++ program it returns this error:

C++ Compiler is missing or invalid

I have no clue what to do, I tried downloading C++ compilers, and still, it returns the same error.

I am very new at Ubuntu, and Linux in general, so if you'd be able to help me step by step, I would really appreciate that.

Thank you.

anders_c_
January 3rd, 2009, 07:44 PM
have you installed the package "g++" try searching for it in synaptic.

jpmelos
January 3rd, 2009, 08:08 PM
Type it in a terminal:


sudo apt-get install build-essentials

But check if your NetBeans is configured to look for "gcc" or "g++" when you try to compile C/C++ code. You can check it in Tools > Options... > C/C++. Fill the "C Compiler" and "C++ Compiler" fields as follows:


C Compiler: /usr/bin/gcc
C++ Compiler: /usr/bin/g++

But it will work only after you install the build-essentials package.

ibuclaw
January 3rd, 2009, 08:14 PM
Type it in a terminal:


sudo apt-get install build-essentials

But check if your NetBeans is configured to look for "gcc" or "g++" when you try to compile C/C++ code. You can check it in Tools > Options... > C/C++. Fill the "C Compiler" and "C++ Compiler" fields as follows:


C Compiler: /usr/bin/gcc
C++ Compiler: /usr/bin/g++

But it will work only after you install the build-essentials package.

Wrong

sudo apt-get install build-essential
There is no trailing 's' in the package name :)

Regards
Iain

nayeret43
January 3rd, 2009, 08:32 PM
It worked!

Thanks!

utnubuuser
January 3rd, 2009, 08:37 PM
Solved? Thread Tool>>Mark thread as solved.