LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-19-2007, 04:39 AM   #1
mykaitch
Member
 
Registered: Feb 2007
Posts: 30

Rep: Reputation: 15
How do I install GCC ?


I have downloaded a tar.gz file from the GNU website to my Windows PC. I have managed to extract this into a folder in my Home folder in my Linux partition. I did this from Gnome. I was unable to make a copy of the original gz file in my windows partition and save that too in Linux but no matter (copy/paste did nothing).
I am waiting for some Linux books to arrive.
How do I install this package ?
I went to the GNU site and there is page after page of steps to take which I think relate to what I will call 'expert installation'. There must be something like an install.exe ( I thought it was called a run file) for this. Any pointers please ? ( Then, I can start work, hurray!).
 
Old 02-19-2007, 04:51 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by mykaitch
I went to the GNU site and there is page after page of steps to take which I think relate to what I will call 'expert installation'
Installing from source, that is from the file.tar.gz you have downloaded, is always a kind of "expert installation". However you can start from reading this sticky post here, a little HOWTO from trickykid.
It would be also useful if you post the Linux distro you are running on: maybe there is an easy way to install GCC not from source, but from a package. The way to do is strictly dependent on your Linux distro and also from the Desktop environment you are running on (GNOME or KDE, just to cite two of the most common ones).

Last edited by colucix; 02-19-2007 at 04:52 AM.
 
Old 02-19-2007, 05:17 AM   #3
mykaitch
Member
 
Registered: Feb 2007
Posts: 30

Original Poster
Rep: Reputation: 15
how to install GCC

I see the word 'distro' a lot. I hope that it means the 'flavor' of Linunx. I am useing Debian Etch, my xserver is Gnome.
I downloaded and unpacked gcc-core-4.0 -20060601.tar.bz2.
As the Forum says its also about helping yourself so I will poke around and see if I can find a GCC package in the meantime. I have made a GCC folder and all the files from .bz2 are in it.
 
Old 02-19-2007, 05:37 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Yes, sorry! Distro is a short for distribution, that is Linux flavour. I am not used with debian, but you can try something like
Code:
apt-get install gcc
from the command line, as root.
By the way, the process to install from source is worth to be learned, since not all the software in the world has been compiled for every linux flavour. The quick way to do installations from source is simply as to issue the following commands:
Code:
cd /dir/where/you/untarred/the/tar.gz/
./configure
make
make check
make install
Briefly, ./configure is a script that check your system to look for compilers, setting flags, and look for any other system component required to perform the installation. make is the command that effectively compile the sources. make check is the command to verify the software you have just compiled (not universally available, however). make install is the command that effectively install (that is copy) the executables to make them available to the users.

Last edited by colucix; 02-19-2007 at 05:38 AM.
 
Old 02-19-2007, 06:08 AM   #5
mykaitch
Member
 
Registered: Feb 2007
Posts: 30

Original Poster
Rep: Reputation: 15
installing GCC

The apt etc command gets so far and fails because of my inet connection so I will fix that and try again.
The second method fails for lots of reasons; no such file as configure, building source not supported, no makefile, and lots of other whinges. BTW what I have is a snapshot which I hope was the right file to download. I will press on with the inet, but thanks so far.
 
Old 02-19-2007, 06:20 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by mykaitch
The second method fails for lots of reasons; no such file as configure, building source not supported, no makefile, and lots of other whinges.
The instructions at http://gcc.gnu.org/install/ are well detailed. Try to follow them step by step and feel free to post any problem here! Regarding "building source not supported", I guess this is "Building in the source directory", indeed. You have to create a directory where you will do the build process:
Code:
% mkdir objdir
% cd objdir
% srcdir/configure [options] [target]
where srcdir is
Code:
/path/to/gcc-4.0-20060601
that is the source directory you have extracted from the tarball (file.tar.gz).
 
Old 02-19-2007, 06:33 AM   #7
mykaitch
Member
 
Registered: Feb 2007
Posts: 30

Original Poster
Rep: Reputation: 15
install GCC

OK. Fixed the net connection and got a message that some files could not be verified, but let it carry on anyway. All fixed . Now I have GCC. It does not appear in my Gnome desktop but if I open a terminal and type gcc -v I get all the version stuff. For work purposes it is there. As always, my thanks.
 
Old 02-19-2007, 06:55 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
You are welcome! gcc cannot be launched from GNOME menu (it would have no-sense, indeed) but from terminal/console only.
 
Old 02-19-2007, 09:46 AM   #9
mykaitch
Member
 
Registered: Feb 2007
Posts: 30

Original Poster
Rep: Reputation: 15
GCC almost

Just because I am writing C doesn't mean I know anything so I am still a newbie! Now then, I have written a small ALSA app and tried to compile it. The main errors are;
missing stdio.h, stdlib.h, alsa/asoundlib.h

and indeed they are missing. Have I made a mess of the GCC install do you think, and, although I can find lots of ALSA files, not the lib file above that is most important.

I continue to search...it was so easy with the BBC B.
 
Old 02-19-2007, 10:24 AM   #10
mykaitch
Member
 
Registered: Feb 2007
Posts: 30

Original Poster
Rep: Reputation: 15
how to install GCC

OK guys. Sorted. I see now I need to get the C libs from GNU. All I have to figure out now is why my ALSDA code is nothing like the API in the manual and I'm off.
 
Old 02-19-2007, 10:36 AM   #11
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You'll also need the package that provides the ALSA headers.
 
Old 02-19-2007, 01:12 PM   #12
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by mykaitch
Just because I am writing C doesn't mean I know anything so I am still a newbie! Now then, I have written a small ALSA app and tried to compile it. The main errors are missing stdio.h, stdlib.h, alsa/asoundlib.h and indeed they are missing.
Yes, sorry. I forgot to mention that you will need to install the C headers files separately. To find which package contains the headers you can issue the command
Code:
dpkg -S stdio.h
The result will be something like libc6-dev. After determining the name of the package containing the header, you can simply do
Code:
apt-get install libc6-dev
e.g. if the package is the one mentioned above.
 
Old 02-19-2007, 07:58 PM   #13
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
The easiest way to install gcc along with a good set of required libraries and make, etc is to use:
Code:
aptitude install build-essential
--Ian
 
Old 02-20-2007, 03:48 AM   #14
mykaitch
Member
 
Registered: Feb 2007
Posts: 30

Original Poster
Rep: Reputation: 15
how to install gcc

So as I read it ( and thaks for SO much help), I have to find a C lib to install - yep that should not difficult, AND and ALSA package too, despite the fact that I seem to have a lot os 'ALSA' stuff already ? This Linux is well weird, but I am hooked. Its that Penguin, its so cute.
 
Old 02-21-2007, 01:20 AM   #15
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You may have the ALSA library installed, which will be used by whatever programs use it. The header files are used for developing programs (they contain function prototypes, amongst other things) and aren't needed when actually using programs.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install or not install newest GCC version on Solaris 10. Zepiroth Solaris / OpenSolaris 6 05-26-2006 03:42 AM
Help me install GCC today! <-- 1yr without gcc :( nectron101 Linux - Newbie 4 04-17-2006 08:57 PM
install new gcc v3.4.5 over gcc v3.2.2 on red hat 9 mlaich Linux - Newbie 2 01-01-2006 09:52 PM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 03:13 PM
Must have gcc to install gcc? thafusion Linux - Software 4 05-28-2004 11:20 PM


All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration