problems installing gcc on debian
I am relatively new to debian. I have installed debian 4.0. I used apt-get install gcc and it installed it, but I can't compile anything. I get the following error message: gcc test.c test.c:1:19: error: stdio.h: No such file or directory test.c:2:20: error: stdlib.h: No such file or directory test.c: In function âmainâ: test.c:7: warning: incompatible implicit declaration of built-in function âprintfâ I did a find for the header files and this all I found: # find / -iname stdio.h -print /usr/lib/gcc/sparc-linux-gnu/4.1.2/include/ssp/stdio.h I am pretty sure I should have more files, but I am not sure what I should install. Any help would be appreciated. Thanks.
|
those files with the .h are header files, they are usually found in /usr/include and Debian and other Debian based distros have a bad habit of stripping them out of packages and naming them as separate packages that end in -dev like xorg-dev and libpng-dev & etc...
this is really an annoying feature with Debian and other Debian based distros, if you prefer to build extra packages from source code you can either dig thru synaptic and install dozens of -dev packages or switch to Slackware or most any other Slackware based distro, Slackware does not strip out the development header files so building source code on Slackware or Slackware based distros (Vector, Zenwalk) is not a problem... so it is up to you how you want to deal with this problem: stick with debian and install lots of packages that should not have been stripped out of the package build in the first place... or: switch to Slackware or Vector or Zenwalk and have all the development headers left intact where they belonged in the first place... |
Think you should do:
# apt-get install build-essentials |
try
Code:
apt-get install libc6-dev |
Quote:
Where is stdio.h? packages.debian.org, take the second input field, put stdio.h You get a lot of results. With a bit of experience, you will take this one: usr/include/stdio.h libdevel/libc6-dev apt-get install libc6-dev And so one for each file missing. Isn't life easy? :) |
Thanks everyone for your help. apt-get build-essential worked like a charm. build-essential brought in libc6-dev and the rest.
|
Quote:
|
All times are GMT -5. The time now is 07:27 PM. |