Bash cc

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Bash cc

Post by alex.barylski »

I'm trying to compile gedit using the ./configure which from what I can tell is rather standard on GNome.

When I did try ./configure I got a bunch of errors one which I traced back to CPAN::XML::Parser

I have ran the CPAN installer and everything goes according to plan until an error saying make not available, so I run make at the cli and sure enough it doesn't exist. I search my HDD and find imake, but no make, so I goto the advanced package manager in ubuntu and install make.

I find the Configure.pm module and adjust the path accordingly, run install XML::Parser from cpan> again and this time I don't get a make error...so it continues a little further :P

Then AGAIN it chokes, this time saying something along the lines:

Code: Select all

/bin/sh: cc: command not found
So I fire up the file manager and try and go to the bin/sh directory and realize sh is a link to an executable...

Code: Select all

/bin/bash/
Bash is what I was under the impression I was using as a shell, so far so good...

bash, I assume is similar to command.com on DOS and has built in commands, one of the being CC (C Compiler?) which I found weird for a shell, but this is open source linux I suppose :P

I've searched high and dry and cannot find anything about what command Bash makes available...but I can find a thread which suggests I replace the CC references with GCC instead, and I know for a fact I have GCC installed as I just ran past it in my Ubuntu package manager.

Edit: I just tried gcc at the cli and got an error, so I guess the binary isn't availble??? :? and it appears cc isn't built into the bash shell either, but somehow linked...

Now my questions:

1) How can I find all occurances of cc and replace them with gcc using grep? How I find the makefile is probably more important :P All though I suppose I could replace all occurances system wide as I don't plan on ever using cc, but gcc.

2) I imagine I can easily figure out how to install gcc, but while I'm here, why doesn't someone give me a heads up ;)

Cheers :)
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

2) I imagine I can easily figure out how to install gcc, but while I'm here, why doesn't someone give me a heads up

Code: Select all

apt-get install build-essential
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

cool...I installed the packages for GCC through the synaptic package manager and the GCC still doesn't seem availble...

I just tried what you suggested and it gave me an permission error, likely because I'm installing other apps as we speak, I"ll try again after it's all done and see what happens :)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

When using apt-get or synaptic, are you using root account?

Code: Select all

# su -
Enter Password:
<password>
root@~ # apt-get install build-essential
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Jenk wrote:When using apt-get or synaptic, are you using root account?

Code: Select all

# su -
Enter Password:
<password>
root@~ # apt-get install build-essential
Yes sir...synaptic gives me an error otherwise...I figured that one out already :P

I just tried again, this time without synaptic downloading and such...

It worked like a charm now I have both gcc and cc :P

Swwwwwwwwwwwwwwweeeeeeeeeeeeeeeeeeeeeeeeeeeeet

Although I swear I downloaded GCC 4 from snyaptic, it didn't work only when I used apt-get did everything seem to install properly...
User avatar
ibbo
Forum Commoner
Posts: 51
Joined: Tue Sep 19, 2006 6:20 am

Post by ibbo »

Bash has many features but commands are pretty much external. If you type help at the bash prompt you get a whole list of various utilities that are part of the shell itself.

Things like gcc are external and BASH then become a cli to execute these. Try typing 'a' and press tab twice. You get a list of all the executables that start with 'a' (be they bash specific or not). Likewise for b,c,d etc.

The real beauty of bash is its scripting capabilities and this gives you the power to tie together various apps to acheive a solution. If your a keen programmer you will be in heaven for some time.

For instance::

type in 'for file in *; do echo $file; done' at the prompt and see a glimpse of its power.

gcc when installed gets a sym link to cc so its the same file as gcc just aliased kind of to cc <they are the same>.

ibbo
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Hockey wrote:I just tried what you suggested and it gave me an permission error, likely because I'm installing other apps as we speak, I"ll try again after it's all done and see what happens :)
You can only run one 'apt' session at a time.. so, if you were in the middle of installing something via the command line, and tried to open synaptic, you'd get an error as well...
Post Reply