gcc not working
Submitted by mrawling on September 27, 2007 - 10:48.
I recently installed Ubuntu on my laptop, and when i went to run gcc for an assignment it couldn't find gcc. I vaguely remember hearing last year that you have to install it seperately, but I have no idea how to do it. Anyone know how?
»
- Login to post comments

sudo apt-get install
sudo apt-get install build-essentials
---
Jordan Kapp
Second Year - BAH/CIS
Canadian Forces Regular Officer - Aerospace Control Officer
im having the same problem
im having the same problem but the above post means absolutely nothing to me...
Aaron
-no affiliation...
-depending on who you ask, i'm either 2nd or 3rd year bcomp.
Type that command into a
Type that command into a terminal.
___________
Josh Gaber
i typed that command and it
i typed that command and it says it cant find the package...
Aaron
-no affiliation...
-depending on who you ask, i'm either 2nd or 3rd or 4th year BComp.
now that i think of it i
now that i think of it i think gcc is already installed... but is there any reason why something would compile on the lab machines and not on mine?
am i missing something else? im just compiling in the terminal...
Aaron
-no affiliation...
-depending on who you ask, i'm either 2nd or 3rd or 4th year BComp.
You *might* have different
You *might* have different versions of gcc installed.
try gcc -v to see how it's configured. It's pretty unlikely that this is the problem though. You'd have to provide output as to why it doesn't compile. There could be missing .h files or something that are part of standard development utils maybe?
im thinking its the missing
im thinking its the missing .h... how do u get the dev utils?
Aaron
-no affiliation...
-depending on who you ask, i'm either 2nd or 3rd or 4th year BComp.
I haven't done this in a
I haven't done this in a very, very long time.
But from browsing Debian package lists, there appears to be
binutils - The GNU assembler, linker and binary utilities
libc6-dev - GNU C Library: Development Libraries and Header Files
There may be other libc6 libraries that you are missing, but it would be weird for you to be missing these packages if you installed some sort of standard dev package that gave you gcc. I was only missing all of these files when I only installed gcc in ubuntu.
That's because the package
That's because the package is build-essential -- no 's'.
Try:
sudo apt-get install build-essential
hmmm definitely worth a
hmmm definitely worth a shot... ill check when i get home... id much rather code at home tonight as opposed to the labs so fingers crossed...
Aaron
-no affiliation...
-depending on who you ask, i'm either 2nd or 3rd or 4th year BComp.
its asking to insert the
its asking to insert the disk, which i no longer have... is it alright to close the terminal for now until i have the disk or will this cause problems in the future when i have the disk and try to install?
it should be safe to close
it should be safe to close the window. you can get apt to download all packages from the internet insted of using the CD. to do this, go to System, administration and package sources. in there remove the check infront of the CD.
best of luck,
------
Matt Englert
SOCIS System Admini
perfect, that worked..
perfect, that worked.. thanks a lot
Sometimes it can be
Sometimes it can be installed as gcc-4.1 or something along those lines and the software never aliased it as gcc. That's happened to me once or twice. You can check /usr/bin to see if it's installed there. 'ls gcc* -all'
Did you try to apt-get install gcc?
Weird gcc problems can also be caused by installing 'gcc' without the dependencies. This is why the 'build-essential' package was created.
ya the build-essential
ya the build-essential package fixed it... thanks everyone... i like ubuntu
Aaron
-no affiliation...
-depending on who you ask, i'm either 2nd or 3rd or 4th year BComp.
Manpages
You might also want to install these packages:
glibc-doc
manpages-dev
...which contain the developer man(ual) pages. For example, try running 'man printf' from a lab computer. It's faster than Google, and covers exactly the same version/variant of the function you're using.
(You can install these packages by running 'sudo apt-get install glibc-doc manpages-dev'.)
ya im figuring out this
ya im figuring out this whole ubuntu thing... its amazing what u can figure out using google searches... the man pages are something i hadnt thought to install though... nice idea
Aaron
-no affiliation...
-depending on who you ask, i'm either 2nd or 3rd or 4th year BComp.