-   Linux - Newbie (
-   -   Why the sh can't find 'cc' when gcc has already been installed? (

lifeicd 08-09-2010 09:20 PM

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.

paulsm4 08-09-2010 09:35 PM

Can it find "gcc"?

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

lifeicd 08-09-2010 09:38 PM

To paul,
Yes, gcc works. 'gcc -v' replies its version and other info.

lifeicd 08-09-2010 09:44 PM

To paul,
the makefile is surprisingly simple:
include build/core/

So I checked this file, still, I can't find any 'CC' symbol.

lifeicd 08-09-2010 10:30 PM

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.

evo2 08-09-2010 10:52 PM

Set the environment variable in one of your login scripts. Eg:

echo 'export CC=/usr/bin/gcc-4.3' >> ~/.bashrc

lifeicd 08-09-2010 11:04 PM

Yes, that's the solution. Really appreciate your help.

Thank everybody for your precious time.

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