LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-09-2010, 08:20 PM   #1
lifeicd
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
Why the sh can't find 'cc' when gcc has already been installed?


Hi, guys,
I am trying to compile an android project, which requires GCC-4.3(mandatory, GCC-4.4 doesn't work). So I downgraded the gcc-4.4 on my ubuntu 10.04 to gcc-4.3.

But then the compiling process doesn't work. It says:
cc: command not found
make: *** [...] error 127

It's weird that the shell can't find 'cc' while I do have gcc-4.3 installed.
I've tried type the following command:
export CC="/usr/bin/gcc-4.3"
but I don't know what's it for.

Can anybody help me? It's been bothering me for hours.

Last edited by lifeicd; 08-09-2010 at 09:31 PM.
 
Old 08-09-2010, 08:35 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Can it find "gcc"?

Does your makefile have a "CC=..." you can change to "CC=gcc"?

Last edited by paulsm4; 08-09-2010 at 08:37 PM.
 
Old 08-09-2010, 08:38 PM   #3
lifeicd
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
To paul,
Yes, gcc works. 'gcc -v' replies its version and other info.
 
Old 08-09-2010, 08:44 PM   #4
lifeicd
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
To paul,
the makefile is surprisingly simple:
include build/core/main.mk

So I checked this file, still, I can't find any 'CC' symbol.
 
Old 08-09-2010, 09:30 PM   #5
lifeicd
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
It seems export CC="/usr/bin/gcc-4.3" can solve this problem, but only for a moment.
I mean if I type the export command before running the makefile, the making process will work.

However, I still don't know how to solve it once and for all.
 
Old 08-09-2010, 09:52 PM   #6
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,302

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Set the environment variable in one of your login scripts. Eg:
Code:
echo 'export CC=/usr/bin/gcc-4.3' >> ~/.bashrc
Evo2.
 
Old 08-09-2010, 10:04 PM   #7
lifeicd
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Yes, that's the solution. Really appreciate your help.

Thank everybody for your precious time.
 
  


Reply

Tags
cc, downgrade, error, gcc


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 Problems marty00 Linux - Software 1 01-08-2006 06:49 PM
GCC Problems..really need help. RoaCh Of DisCor Linux - Newbie 11 05-10-2005 06:14 PM
Problems Compiling Problems With GCC And C++ phnxbn Linux - Software 0 11-02-2004 05:49 PM
GCC problems natm Linux - Newbie 8 10-17-2004 09:42 PM
GCC problems garf12 Linux - Software 1 03-07-2004 09:59 PM


All times are GMT -5. The time now is 02:29 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration