C programs Solved

Marius Gedminas marius at pov.lt
Tue Feb 26 18:23:21 UTC 2008


On Tue, Feb 26, 2008 at 09:38:30AM -0700, Karl Larsen wrote:
> Marius Gedminas wrote:
> > On Tue, Feb 26, 2008 at 08:46:17AM -0700, Karl Larsen wrote:
> >> karl at karl-desktop:~/Cprog$ gcc fathm_ft.c
> >> fathm_ft.c:2:19: error: stdio.h: No such file or directory
> >>
> >>     Now it can't find stdio.h and why is that?
> >>     
> >
> > You do not have the libc6-dev package installed.  Other things might be
> > missing as well -- if you want to build C programs, install the
> > build-essential package to make sure you get all the necessary packages.

I was slightly mistaken about the purpose of build-essential.  After
checking the description I now see that it is needed for building Debian
packages.  For arbitrary C programs it should be enough to install gcc
and libc6-dev.

> >> I thought stdio.h is a standard C header.
> >
> > Yes it is, but the C standard library headers are shipped in a different
> > package from the C compiler.
> >   
>     Thank you so much for the information. I got the build-essential 
> package and now it compiles no problem. I must say however that a c 
> compiler without libs is not worth much :-)

You're absolutely right, but there's more than one implementation of the
standard C library (libc6, dietlibc, klibc, probably more).  And there
are also programs (like the Linux kernel) that do not use the standard C
library.

>     It looks like I got the g++ cross compiler as well. Thanks again.

Cross compiler?  I doubt it.  "Cross compiler" means a compiler that
produces executables for a different platform.  What you got is a C++
compiler.

Marius Gedminas
-- 
WARN_(accel)("msg null; should hang here to be win compatible\n");
        -- WINE source code
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080226/1ca64a3e/attachment.sig>


More information about the ubuntu-users mailing list