LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-01-2006, 03:52 PM   #1
Peter Shepard
Member
 
Registered: Apr 2005
Posts: 96

Rep: Reputation: 15
C compiler 6.02?


Hello,

I just installed the 6.02 Ubuntu distro and am trying to set a path to my C compiler as well as gcc. Can anyone tell me where these are located?

Thanks
 
Old 08-01-2006, 04:15 PM   #2
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
Do you perhaps mean Ubuntu 6.06 (Dapper Drake)?

there's a cool command you can run that tells you the location of the command you're looking for...

Code:
kev@Rei:~]$ whereis gcc cc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/bin/X11/gcc /usr/share/man/man1/gcc.1.gz
cc: /usr/bin/cc /usr/bin/X11/cc /usr/share/man/man1/cc.1.gz
the executables (i.e. gcc and cc) are in /usr/bin, i'm not really sure what the libs are for, and the last thing is usually the man pages (help documentation)

when you say 'set a path' to your compiler, do you mean create a shortcut or set an environment variable? Or something else?
 
Old 08-01-2006, 05:20 PM   #3
Peter Shepard
Member
 
Registered: Apr 2005
Posts: 96

Original Poster
Rep: Reputation: 15
gcc ubuntu Dapper Drake

Thanks for the whereis command. However it inly returns a path to gcc and not c or cc? I have to believe that ubuntu somes with a compiler for C? Or do I have to downlaod it?

Thanks again...
 
Old 08-01-2006, 11:07 PM   #4
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
try
Code:
sudo apt-get install build-essential
that will install the compilers and other thing you need.
 
Old 08-01-2006, 11:12 PM   #5
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
I dunno about cc. I installed it a long time ago and cannot figure out how I did it. Ubuntu has an awesome software management utility called synaptic. To launch it select in the top left menu "System -> Administration -> Synaptic Package Manager"

In almost any case, the gcc compiler is plenty good to compile your C/C++ stuff. Sometimes a lot of make builds ask for the location of the C Compiler and you can usually get by with this:
Code:
export CC="/usr/bin/gcc"
So if I were going to download and build something from source I would do something like this.

Code:
#######download your program.tar.gz file
$ gzip -d program.tar.gz
$ tar -xf program.tar
$ rm program.tar ##### delete the download file after you unpack it. Only if you want to, you can keep it - makes no difference
$ cd program_directory
$ ./configure
$ export CC="/usr/bin/gcc"
$ make
$ sudo make install
But don't forget to check synaptic for your program before you build a copy from source. Synaptic keeps track of all installed files, makes upgrading programs way easy, and allows you to safely delete the program and keep your system from descending into the 9th level of dependency hell.


EDIT: Didn't see the previous post until after I submitted, but Binary's suggestion is a better one.

Last edited by fourchannel; 08-01-2006 at 11:15 PM.
 
  


Reply



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
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
C++ IDE+Compiler?Java IDE+compiler? Boby Linux - Software 3 05-31-2005 01:12 PM
Compiler conundrum: Which came first, a compiler, or it's source code? fr0zen Programming 21 01-29-2004 04:31 AM
No compiler to compiler the compliler NewtonIX Linux - Newbie 13 11-03-2003 05:32 AM
compile a compiler without a compiler? lackluster Linux - General 18 01-02-2003 07:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 10:53 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
Open Source Consulting | Domain Registration