LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   problems installing gcc on debian (https://www.linuxquestions.org/questions/linux-software-2/problems-installing-gcc-on-debian-564365/)

unixpgmr 06-25-2007 10:18 AM

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.

Okie 06-25-2007 10:30 AM

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...

brianL 06-25-2007 10:41 AM

Think you should do:
# apt-get install build-essentials

cyberfishee 06-25-2007 04:51 PM

try
Code:

apt-get install libc6-dev
that installs standard headers and libraries

nx5000 06-25-2007 04:54 PM

Quote:

I get the following error message: gcc test.c test.c:1:19: error: stdio.h: No such file or directory test.c
stdio.h is missing
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? :)

unixpgmr 06-25-2007 07:16 PM

Thanks everyone for your help. apt-get build-essential worked like a charm. build-essential brought in libc6-dev and the rest.

cyberfishee 06-25-2007 07:28 PM

Quote:

stdio.h is missing
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?
Yes, that is precisely what I did.


All times are GMT -5. The time now is 07:27 PM.