1

i am new Linux user. Currently installed Ubuntu 14.04 LTS. I have installed code Blocks from Ubuntu Software Center. i have tried to create c file. But the problem is that after creating any Projects or Empty file when clicking the build and Run option it is showing that the project has not build yet. In the build log the following message has shown

gcc   -c /home/u/ProGrams/C_CodeBlocks/TestProject/main.c -o /home/u/ProGrams/C_CodeBlocks/TestProject/main.o
g++  -o /home/u/ProGrams/C_CodeBlocks/TestProject/main /home/u/ProGrams/C_CodeBlocks/TestProject/main.o   
/bin/sh: 1: g++: not found
Process terminated with status 127 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Checking for existence: /home/u/ProGrams/C_CodeBlocks/TestProject/main
Executing: terminology -M -T '/home/u/ProGrams/C_CodeBlocks/TestProject/main' -e  /usr/bin/cb_console_runner "/home/u/ProGrams/C_CodeBlocks/TestProject/main" (in /home/u/ProGrams/C_CodeBlocks/TestProject)
Process terminated with status 255 (0 minute(s), 34 second(s))

Then searched net, found some solutions that the compiler may not set as gcc. I have only one complier in my machine,in time creating project, i have selected the gcc compiler. But the problem remain Same.

Another solution that Settings-> Compiler-> Toolchain executables i have selected once Auto-Detect option and once the /usr/bin. But the problem not gone.

Help me to solve this problem...! If any additional information needed, please dont forget to tell.

11
  • 2
    gcc looks fine, install g++. Commented Apr 27, 2015 at 11:53
  • would u please tell me how to install g++? Commented Apr 27, 2015 at 11:56
  • Try replacing g++ by gcc. I don't know why codeblocks uses g++, as the end-user should only use gcc, which is a front-end tool, designed to call the correct compiler, depending on some context (file extension mostly, I think) Commented Apr 27, 2015 at 11:57
  • maybe this will help? Commented Apr 27, 2015 at 11:58
  • u@u-HP:~$ sudo apt-get install g++ Reading package lists... Done Building dependency tree Reading state information... Done E: The package virtualbox-4.3 needs to be reinstalled, but I can't find an archive for it. What can be done now. @Sourav Ghosh Commented Apr 27, 2015 at 12:09

1 Answer 1

1

Install g++

Go to your terminal(ctrl+alt+T) and type

sudo apt-get install g++

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.