LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-14-2016, 04:30 PM   #1
djohan
LQ Newbie
 
Registered: Oct 2014
Location: La Honda, California
Distribution: Red Hat 9.0, Precise Puppy 5.7.1
Posts: 12

Rep: Reputation: Disabled
Question gcc error finding 'cc1' file


I am using DELL Precision-M2800 with Ubunto installed. gcc is also installed. I ran a simple c program:

#include<stdio.h>
main(){ printf("Hello world!\n"); }

$ gcc test.c
and get:
gcc: error trying to exec 'cc1': execvp: No such file or directory

I tried:
$ sudo apt-get install build-essential
with same result.

I searched LQ and found several threads with same problem but no solutions. Dating back several years. As gcc has worked for me on very sophisticated c programs running Red Hat 9 and lately Puppy-Precise I am asking how to fix this problem with Ubuntu gcc.

Thanks,
djohan
 
Old 05-15-2016, 11:08 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 17,557

Rep: Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938
there is no ubuntu gcc, but anyway you need to force reinstall c compiler.
 
1 members found this post helpful.
Old 05-15-2016, 02:35 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Your file test.c
Code:
#include<stdio.h>
main(){ printf("Hello world!\n"); }
... works OK here : With gcc-4.9 . The executable result replies "Hello world!".

$ sudo apt-get install build-essential
.. will install g++ and gcc .
If Ubuntu 16.04, you will get gcc-5
http://packages.ubuntu.com/xenial/gcc-5
... and the Ubuntu patched gcc-5 (5.3.1) may fail with some programs?
Please try : 1) $ sudo apt-get install gcc-4.9
2) $ gcc-4.9 test.c


-
 
1 members found this post helpful.
Old 05-16-2016, 10:14 PM   #4
djohan
LQ Newbie
 
Registered: Oct 2014
Location: La Honda, California
Distribution: Red Hat 9.0, Precise Puppy 5.7.1
Posts: 12

Original Poster
Rep: Reputation: Disabled
$ sudo apt-get install gcc-4.9
[sudo] password for don:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-4.9
E: Couldn't find any package by regex 'gcc-4.9'

$ gcc-4.9 test.c
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.2.44
don@don-Precision-M2800:~/CREATE3d$
 
Old 05-17-2016, 01:22 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 17,557

Rep: Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938Reputation: 5938
so you installed nothing, and tried a non-existent app to run. Trusty has only gcc-4.8, so you need to install either gcc or gcc-4.8. Try: apt-get --reinstall install gcc
 
1 members found this post helpful.
Old 05-17-2016, 01:33 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,534

Rep: Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622
What version of ubuntu are you using ?????

also post the output of this

Code:
gcc -v
this is just a basic "hello world "


HOWEVER
if you only ran
Code:
gcc test.c
then all you will get is a "a.out"

use this
Code:
gcc -o test test.c

./test
 
Old 05-17-2016, 04:25 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
Quote:
Originally Posted by John VV View Post
What version of ubuntu are you using ?????
[/code]
+1
Quote:
command-not-found has crashed!
Seems like an old ubuntu bug (a wrong locale setting problem)
 
Old 05-18-2016, 12:53 PM   #8
djohan
LQ Newbie
 
Registered: Oct 2014
Location: La Honda, California
Distribution: Red Hat 9.0, Precise Puppy 5.7.1
Posts: 12

Original Poster
Rep: Reputation: Disabled
Response to two commands follows:
Ubuntu was provided Precision-M2800 by DELL.
Version (I believe) is 14.04.1 LTS. I don't
know how to qwery for version #.


don@don-Precision-M2800:~/CREATE3d$ gcc -v
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)
don@don-Precision-M2800:~/CREATE3d$
don@don-Precision-M2800:~/CREATE3d$
don@don-Precision-M2800:~/CREATE3d$ gcc -o test test.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
don@don-Precision-M2800:~/CREATE3d$
 
Old 05-18-2016, 01:18 PM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
Maybe an architecture problem? Could you post output with:
Code:
gcc -print-prog-name=cc1
Code:
uname -a
 
1 members found this post helpful.
Old 05-18-2016, 01:19 PM   #10
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,534

Rep: Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622
non standard characters can cause problems sometimes

you might want to remove the "$" from the name of the folder

Last edited by John VV; 05-18-2016 at 01:25 PM.
 
1 members found this post helpful.
Old 05-18-2016, 01:39 PM   #11
djohan
LQ Newbie
 
Registered: Oct 2014
Location: La Honda, California
Distribution: Red Hat 9.0, Precise Puppy 5.7.1
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks Here is output. The $ is not part of the folder. Looks to be
provided by terminal prompt.

on@don-Precision-M2800:~/CREATE3d$ gcc -print-search-dirs
install: /usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/
programs: =/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/:/usr/local/bin/../lib/gcc/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/4.6/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/
libraries: =/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/:/usr/local/bin/../lib/gcc/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/4.6/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/../lib/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/4.6/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/:/lib/x86_64-linux-gnu/4.6/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/4.6/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/:/usr/local/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../:/lib/:/usr/lib/
don@don-Precision-M2800:~/CREATE3d$
 
Old 05-18-2016, 01:43 PM   #12
djohan
LQ Newbie
 
Registered: Oct 2014
Location: La Honda, California
Distribution: Red Hat 9.0, Precise Puppy 5.7.1
Posts: 12

Original Poster
Rep: Reputation: Disabled
To: keefaz- Here is more.

don@don-Precision-M2800:~/CREATE3d$ uname -a
Linux don-Precision-M2800 3.5.0-61-generic #90-Ubuntu SMP Sun Apr 26 11:23:53 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
don@don-Precision-M2800:~/CREATE3d$

Thanks for help.
 
Old 05-18-2016, 01:58 PM   #13
djohan
LQ Newbie
 
Registered: Oct 2014
Location: La Honda, California
Distribution: Red Hat 9.0, Precise Puppy 5.7.1
Posts: 12

Original Poster
Rep: Reputation: Disabled
Here is more:

don@don-Precision-M2800:~/CREATE3d$
don@don-Precision-M2800:~/CREATE3d$ gcc -print-prog-name=cc1
cc1
don@don-Precision-M2800:~/CREATE3d$ uname -a
Linux don-Precision-M2800 3.5.0-61-generic #90-Ubuntu SMP Sun Apr 26 11:23:53 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
don@don-Precision-M2800:~/CREATE3d$

Thanks
Don
 
Old 05-18-2016, 02:36 PM   #14
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
Thanks for the outputs, so gcc doesn't find cc1 indeed...
I notice your gcc appears to search files in /usr/local, while its install prefix is /usr from gcc -v output, I don't know if it's relevant.

Could you perform a file search to find if there is a cc1 somewhere in your system?

Edit: search could be shorten with:
Code:
ls /usr/lib/gcc/*/*/cc1
ls /usr/local/lib/gcc/*/*/cc1

Last edited by keefaz; 05-18-2016 at 03:03 PM.
 
1 members found this post helpful.
Old 05-18-2016, 03:12 PM   #15
djohan
LQ Newbie
 
Registered: Oct 2014
Location: La Honda, California
Distribution: Red Hat 9.0, Precise Puppy 5.7.1
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks keefaz- here is output.
Looks like it's there.
I could copy it, but to where?
Don

don@don-Precision-M2800:~/CREATE3d$
don@don-Precision-M2800:~/CREATE3d$ ls /usr/lib/gcc/*/*/cc1
/usr/lib/gcc/i686-w64-mingw32/4.6/cc1 /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1
/usr/lib/gcc/x86_64-linux-gnu/4.6.3/cc1 /usr/lib/gcc/x86_64-w64-mingw32/4.6/cc1
don@don-Precision-M2800:~/CREATE3d$
don@don-Precision-M2800:~/CREATE3d$ ls /usr/local/lib/gcc/*/*/cc1
ls: cannot access /usr/local/lib/gcc/*/*/cc1: No such file or directory
don@don-Precision-M2800:~/CREATE3d$
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
gcc: installation problem, cannot exec `cc1': No such file or directory digimars Linux - General 2 11-25-2008 03:17 AM
gcc: installation problem, cannot exec `cc1': No such file or directory Error Message 08h Programming 2 07-20-2006 12:44 PM
gcc: installation problem, cannot exec `cc1': No such file or directory natsirc Linux - General 3 11-11-2004 10:26 AM
gcc: installation problem, cannot exec `cc1': No such file or directory Error Message 08h Linux - Newbie 1 06-01-2004 05:26 AM
gcc: Internal compiler error: program cc1 got fatal signal 11 smj Linux - Software 2 02-20-2003 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:24 PM.

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