Page 1 of 1

Help for a Beginner in Codelite Ubuntu

Posted: Tue Jan 13, 2015 5:29 am
by reddy
I have downloaded Codelite for Ubuntu and installed on my PC. I just ran " Hello World " to get familiar with controls. And this is the output I am getting after trying to build and run the project even there aren't any errors in my program.

/bin/sh -c '/usr/bin/make -j4 -e -f Makefile'
----------Building project:[ k - Debug ]----------
make[1]: Entering directory '/home/swet/Desktop/k'
/usr/bin/gcc-4.8 -c "/home/swet/Desktop/k/k.c" -g -O0 -Wall -o ./Debug/k.c.o -I. -I.
/usr/bin/g++-4.8 -o ./Debug/k @"k.txt" -L.
/bin/sh: 1: /usr/bin/g++-4.8: not found
k.mk:76: recipe for target 'Debug/k' failed
make[1]: *** [Debug/k] Error 127
make[1]: Leaving directory '/home/swet/Desktop/k'
Makefile:4: recipe for target 'All' failed
make: *** [All] Error 2
1 errors, 0 warnings

Although I can still run the code, I don't want to see that error warning. I would really appreciate if you could help me out how to eliminate that error warning.

Re: Help for a Beginner in Codelite Ubuntu

Posted: Tue Jan 13, 2015 10:37 am
by eranif
Do you have g++ installed?
For me, it exists:

Code: Select all

eran@ubuntu-14-04-64:~$ ls -l /usr/bin/g++-4.8 
-rwxr-xr-x 1 root root 775888 אפר  5  2014 /usr/bin/g++-4.8
Try installing the build-essential package:

Code: Select all

sudo apt-get install build-essential
This should fix it

Eran

Re: Help for a Beginner in Codelite Ubuntu

Posted: Tue Jan 13, 2015 11:48 am
by reddy
It didn't work. It is showing build essential is already newest version.

Re: Help for a Beginner in Codelite Ubuntu

Posted: Tue Jan 13, 2015 1:25 pm
by DavidGH
Hi,

In my experience, ubuntu installs the 'g++' package by default. I'm fairly sure it did so for my ubuntu 14.04 VBox guest (I presume it's 14.04 that you're using).

What is the output of doing:
ls -l /usr/bin/g++*

Also try doing:
g++ -v

If these suggest that g++ isn't installed, do:
sudo apt-get install g++

Regards,

David

Re: Help for a Beginner in Codelite Ubuntu

Posted: Wed Jan 14, 2015 12:23 am
by reddy
g++ is installed by default.

Nevertheless I still checked it in terminal by running

ls -l /usr/bin/g++*

lrwxrwxrwx 1 root root 7 Sep 5 00:32 /usr/bin/g++ -> g++-4.9
-rwxr-xr-x 1 root root 810824 Oct 11 14:36 /usr/bin/g++-4.9

For g++ -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.9/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.1-16ubuntu6' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6)

When I ran this sudo apt-get install g++

Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

It still didn't work for me. The error still exists unfortunately. :cry:

Re: Help for a Beginner in Codelite Ubuntu

Posted: Wed Jan 14, 2015 1:32 am
by foxmuldr
reddy wrote:I have downloaded Codelite for Ubuntu and installed on my PC. I just ran " Hello World " to get familiar with controls. And this is the output I am getting after trying to build and run the project even there aren't any errors in my program.

/bin/sh -c '/usr/bin/make -j4 -e -f Makefile'
----------Building project:[ k - Debug ]----------
make[1]: Entering directory '/home/swet/Desktop/k'
/usr/bin/gcc-4.8 -c "/home/swet/Desktop/k/k.c" -g -O0 -Wall -o ./Debug/k.c.o -I. -I.
/usr/bin/g++-4.8 -o ./Debug/k @"k.txt" -L.
/bin/sh: 1: /usr/bin/g++-4.8: not found
k.mk:76: recipe for target 'Debug/k' failed
make[1]: *** [Debug/k] Error 127
make[1]: Leaving directory '/home/swet/Desktop/k'
Makefile:4: recipe for target 'All' failed
make: *** [All] Error 2
1 errors, 0 warnings

Although I can still run the code, I don't want to see that error warning. I would really appreciate if you could help me out how to eliminate that error warning.
Above it shows g++ 4.8, but below it shows that g++ 4.9 is the one installed. Try re-selecting a default compiler. Also, try this from the command line:

Code: Select all

cd /home/swet/Desktop/k
g++ -c k.c -g -O0 -Wall -o ./Debug/k.c.o
And see if it compiles to the ./Debug/k.c.o location.

Re: Help for a Beginner in Codelite Ubuntu

Posted: Wed Jan 14, 2015 10:39 am
by eranif
go to: settings->build settings->compilers

find the compiler you are using, and change tools to point to g++-4-9 instead of g++-4.8
OR:
settings->build settings->compilers->Add compilers->scan computer for installed compilers

and it should pick the g++-4.9 compiler
Try to build your project again

Eran