You must set the environment variable CC to a working compil

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
rich_m

You must set the environment variable CC to a working compil

Post 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?
mystran

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

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

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

Post 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.)
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

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

Post 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.
rich_m

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

Post 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.
mystran

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

Post 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.
rich_m

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

Post 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.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

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

Post 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 :)
mystran

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

Post 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. :)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

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

Post 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)
Every good solution is obvious once you've found it.
rich_m

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

Post by rich_m »

i got gcc working, any links on how to "recompile the kernel" would be great.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

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

Post 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.
Post Reply