Page 1 of 1

You must set the environment variable CC to a working compil

Posted: Thu May 18, 2006 2:17 pm
by rich_m
I have been trying to install gcc.

I got the following error while configuring...

Code: Select all

root@laptop objdir]# ../gcc-3.0.4/configure--prefix=/opt/gcc-3.0.4
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /gcc3/gcc-3.0.4 using "mt-frag"
../gcc-3.0.4/configure: line 7: cc: command not found
*** The command 'cc -o conftest -g  conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
how do i do tht?

Re:You must set the environment variable CC to a working com

Posted: Thu May 18, 2006 5:56 pm
by mystran
If you want to install gcc from sources, then you need a C compiler that can compile it for you, after which you recompile gcc with itself (script should do it automatically anyway).

This process is called bootstrapping.

You can't install gcc from sources without having a C compiler that can compile gcc, so if you are on a system which does not have one, I suggest you get gcc as binary release, install that, and either keep that, or use that to recompile gcc from sources.

Ofcourse, if you do have a working gcc on your system, then the cc symlink to gcc is just broken, but I find that highly unlikely.

Re:You must set the environment variable CC to a working com

Posted: Fri May 19, 2006 12:57 am
by Solar
(What mystran correctly implies is, every UNIX-ish compiler I know of does set the cc alias when installed, so your error message hints at your system not having a compiler available yet.)

Re:You must set the environment variable CC to a working com

Posted: Fri May 19, 2006 9:26 am
by Candy
Which would be a logical reason to download a compiler. Point is, compilers need to bootstrap, which means that you need a working compiler to get a working compiler. Yes, that means you always start with a binary compiler (or manual translation) to end up with a binary compiler. Since manual translation isn't needed when you have a compiler, download a binary compiler to compile your new source compiler (or just use a binary compiler). You cannot install your first compiler from source.

Re:You must set the environment variable CC to a working com

Posted: Fri May 19, 2006 10:49 am
by rich_m
ok i got that workin....... My red hat cd had some gcc file, which all i had to do was click and wait. Why cant most sw for linux come out like that? This building and making is not so user friendly.

Re:You must set the environment variable CC to a working com

Posted: Fri May 19, 2006 5:46 pm
by mystran
In Debian, people say: apt-get install packagename
In Gentoo, people say: emerge packagename
...

Most systems have something like that actually. Gentoo and BSD Ports usually do the compilation for you, while Debian and others just get a binary package and install that.

I'm relatively confident that your RedHat probably does have a similar tool (since Fedora, the free "redhat" does, can't remember what it uses though), with a pretty decent selection of programs, so in most cases you shouldn't have to install anything manually.

The rule for installing Linux software: get your automatic package installer to work, and keep it up to date. Then when you want some program, always check your packacing system first. Only then consider installing manually.

The real reason those things rule, is because they work out dependencies for you, so if they promise they install something, they usually won't fail, while manual install often requires installing related libraries and what not first.

Re:You must set the environment variable CC to a working com

Posted: Tue May 23, 2006 11:46 am
by rich_m
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernal with module support enabled.
This is what i get when i installing....... when i type 'make config' the msg "No rule to make target congfig" appears.

Re:You must set the environment variable CC to a working com

Posted: Tue May 23, 2006 11:56 am
by Candy
rich_m wrote:
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernal with module support enabled.
This is what i get when i installing....... when i type 'make config' the msg "No rule to make target congfig" appears.

You might want to not make typo's... and if you do, look at them before you post it on a public forum :)

Re:You must set the environment variable CC to a working com

Posted: Tue May 23, 2006 5:04 pm
by mystran
I don't think typoes are bad, I typo myself all the time, but please, try to avoid typoes in message given by a computer, because if, for example, you actually got the above message, then you would have typed "make congfig" which most definitely won't work. :)

Re:You must set the environment variable CC to a working com

Posted: Wed May 24, 2006 3:49 pm
by Solar
rich_m wrote: This is what i get when i installing....... when i type 'make config' the msg "No rule to make target congfig" appears.
You would have to be in /usr/src/linux before you type "make config". But that wouldn't help you because you'd need a working compiler to recompile your kernel. 8)

Re:You must set the environment variable CC to a working com

Posted: Mon May 29, 2006 12:43 pm
by rich_m
i got gcc working, any links on how to "recompile the kernel" would be great.

Re:You must set the environment variable CC to a working com

Posted: Mon May 29, 2006 2:09 pm
by Candy
rich_m wrote: i got gcc working, any links on how to "recompile the kernel" would be great.
The short overview is "make menuconfig dep clean bzlilo modules modules_install && reboot". The long overview creates 326000 hits at google.