LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   installing gcc compiler (https://www.linuxquestions.org/questions/ubuntu-63/installing-gcc-compiler-481361/)

Carunkumar 09-07-2006 03:17 PM

installing gcc compiler
 
hi everyone,

I am new to linux os and I am using Ubuntu.I want to compile c and c++ programs.My friend told me to use the gcc command but it says "bash:gcc:command not found". If I have to install gcc how should I do it?

Thank you!

weibullguy 09-07-2006 03:29 PM

You should be able to install it using the Ubuntu package manager. Something along the lines of
Code:

sudo apt-get install gcc
Then you can try Eclipse or Anjuta if you're looking for an IDE.

binary_y2k2 09-07-2006 09:54 PM

I would recommend the "build-essential" package, it has gcc, make, c++ and other packages you need to compile source code.

crash_override_me 09-08-2006 04:22 AM

if u have an internet connection....

open terminal-->
use::

sudo apt-get install build-essentials

it'll automatically download & install all necessary packages..

Carunkumar 09-08-2006 06:06 AM

I tried the command sudo apt-gtm build-essential and it worked.Now a able to compile both c and c++ files.Thank you all for the help!

crash_override_me 09-08-2006 10:09 AM

Quote:

Originally Posted by Carunkumar
I tried the command sudo apt-gtm build-essential and it worked.Now a able to compile both c and c++ files.Thank you all for the help!

dude, its not 'gtm' its 'get'

anyways go write some code now..!!

binary_y2k2 09-08-2006 10:15 AM

Quote:

Originally Posted by crash_override_me
if u have an internet connection....

build-essentials is also on the CD (desktop and alternate) so you don't even need an internet connection

crash_override_me 09-08-2006 10:18 AM

thanx for the info. dude..

wat other packages are there on the CD?? Cause i am really pissed off using the internet everytime i need a new package..!!

binary_y2k2 09-08-2006 10:36 AM

the package I know are available are:
Code:

binutils
bpalogin
build-essential
dpkg
drdsl
eagle-usb
fakeroot
gcc-4.0
gcc-defaults
glibc
isdnutils
linux-atm
linux-kernel-headers
linux-meta
linux-restricted-modules-2.6.15
linux-source-2.6.15
linux-wlan-ng
make
ndiswrapper
pptp-linux
setserial

Just look in the pool/ directory of the CD.

If you have a line like
Code:

deb cdrom:[Ubuntu 6.06 _Dapper Drake_ - Release i386 (20060531)]/ dapper main restricted
then the package manager will use the CD if there is no newer version on the net, but by now it's more likely to need the internet. It's only really useful when you have no internet connection. E.g build-essential on the 6.06 disk is version 11.1 but on the internet it's 11.3 so apt will choose the one off the internet.

crash_override_me 09-08-2006 10:39 AM

so where do all the packages that i download thru 'apt' go...??
in which directory/??

binary_y2k2 09-08-2006 10:47 AM

They are saved in /var/cache/apt/archives

crash_override_me 09-08-2006 11:21 AM

where do i get the current kernel's source??

binary_y2k2 09-09-2006 05:16 AM

To get the current kernel source (2.6.15) install linux-source-2.6.15, you get that from the web (42MB). I did say it was on the CD, but it's not, guess it's to big to waste that much space on a CD.

crash_override_me 09-10-2006 09:20 AM

the whole kernel is there as a package..
linux-source-2.6.15 ??

binary_y2k2 09-10-2006 10:05 AM

yep, the whole source from kernel.org with ubuntu patches. The package is about 43MB and puts linux-source-2.6.15.tar.bz2 in /usr/src/
You can also get the source with "apt-get source linux-image-`uname -r`"


All times are GMT -5. The time now is 11:19 AM.