LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-14-2012, 08:28 AM   #1
samirnext
LQ Newbie
 
Registered: Oct 2012
Posts: 4

Rep: Reputation: Disabled
Cannot compile any c++


hi ,

i have this output error when i compil any c or cpp file
I get this as output:

gcc: error trying to exec 'cc1': execvp: No such file or directory

thank for the help .
 
Old 10-14-2012, 08:45 AM   #2
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
On Ubuntu, you're not able to compile programs if you've not installed the build-essential meta package with apt. You can do it with:
Code:
sudo apt-get install build-essential

Last edited by 414N; 10-14-2012 at 08:55 AM. Reason: Changed suggestion
 
Old 10-14-2012, 08:58 AM   #3
samirnext
LQ Newbie
 
Registered: Oct 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
i do this
but the same problem .
 
Old 10-14-2012, 09:03 AM   #4
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
Care to explain better and be more descriptive about the build process you're using and the errors you're getting?
No one can help you if you don't report what you're doing, how you're doing it and what error messages you're getting during the process.
For example, from your previous post I still don't know if the apt-get command successfully installed all the build tools inside build-essential. I just have to guess you know how to use apt and that it performed the task successfully, but I don't know it for sure.
Please use [code][/code] tags if you're posting command output and/or source code, so the formatting can be preserved.

Last edited by 414N; 10-14-2012 at 09:08 AM. Reason: Fixed a typo
 
Old 10-14-2012, 09:14 AM   #5
samirnext
LQ Newbie
 
Registered: Oct 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
i upgrade gcc from 4.3 to 4.6.1
when i compil boost libray
Code:
/bootstrap.sh
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
I get this log:

Code:
###
### Using 'gcc' toolset.
###
rm -rf bootstrap
mkdir bootstrap
gcc -o bootstrap/jam0 command.c compile.c debug.c expand.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c
 
gcc: error trying to exec 'cc1': execvp: No such file or directory
gcc: error trying to exec 'cc1': execvp: No such file or directory
.
.
gcc: error trying to exec 'cc1': execvp: No such file or directory
gcc: error trying to exec 'cc1': execvp: No such file or directory
gcc: error trying to exec 'cc1': execvp: No such file or directory
after i do a small test
i create a sample file test.c

Code:
#include<stdio.h>
main(){
  printf("oke!\n");
}
Code:
gcc test.c
the output is
Code:
gcc: error trying to exec 'cc1': execvp: No such file or directory
i thinks that is path config ???
 
1 members found this post helpful.
Old 10-14-2012, 09:18 AM   #6
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
How have you upgraded gcc from version 4.3 to 4.6.1 and why did you do it? Is it a requirement for boost?
 
Old 10-14-2012, 09:21 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Some commands that might help diagnose the problem:
Code:
which gcc
gcc -v
Quote:
Originally Posted by 414N View Post
How have you upgraded gcc from version 4.3 to 4.6.1
But that is still an important question.

Last edited by johnsfine; 10-14-2012 at 09:22 AM.
 
Old 10-14-2012, 09:26 AM   #8
samirnext
LQ Newbie
 
Registered: Oct 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
to upgrade gcc i use

Code:
apt-get install gcc-4.6
which gcc return:

Code:
/usr/bin/gcc
gcc -v return:
Code:
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
 
Old 10-14-2012, 10:06 AM   #9
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by samirnext View Post
Code:
gcc: error trying to exec 'cc1': execvp: No such file or directory
Quote:
Originally Posted by samirnext View Post
gcc -v return:
Code:
--prefix=/usr --program-suffix=-4.6
I think that means when trying to exex 'cc1' gcc is actually trying to exec
/usr/bin/cc1-4.6

So, does that file exist and is it what it should be?
Code:
file /usr/bin/cc1-4.6
ldd /usr/bin/cc1-4.6
(Maybe someone reading this thread, who has gcc working correctly in Ubuntu should be checking whether I interpreted all this correctly. I don't have Ubuntu installed at the moment and I don't have any gcc configured with a suffix.)

Edit: I just checked packages.ubuntu.com and according to that, the correct cc1 is:
/usr/lib/gcc/x86_64-linux-gnu/4.6/cc1
So I'm confused. Maybe I'm misunderstanding what the prefix and suffix reported by gcc -v indicate. Or maybe that is an indication of the OP's problem.

Last edited by johnsfine; 10-14-2012 at 10:13 AM.
 
1 members found this post helpful.
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Eglibc cannot compile suffix of object files while trying to cross compile Bry6n Linux From Scratch 0 08-21-2012 06:14 PM
The error compile C/C++ in linux (but it does compile on Win) hikaru1505 Programming 2 12-30-2010 09:11 AM
[Compile kernel] How to compile/install the modules ? frenchn00b Linux - General 1 09-06-2009 03:18 PM
CLFS 5.9 - Glibc compile: suffix of object files, cannot compile Noddegamra Linux From Scratch 3 04-27-2009 12:49 AM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 04:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration