Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ubuntu gcc: where are the headers?

304 views
Skip to first unread message

Ian

unread,
Jun 3, 2007, 9:12:49 AM6/3/07
to
Folks, I think this may be a daft question, but ...

I seem to have gcc installed on my PC. Synaptic tells me it's there
and gcc <filename> does what I'd expect ... except that it won't
compile anything because it throws up an error at

#include <stdio.h>

and a search indicates that there is, indeed, no stdio.h installed
anywhere.

I've been writing in C for about 20 years, and I have never come
across a compiler without the standard libraries/header files. Help!

Ian

Tweedale

unread,
Jun 3, 2007, 9:34:08 AM6/3/07
to
On 3 Jun 2007 at 13:12, Ian wrote:
> Folks, I think this may be a daft question, but ...
>
> I seem to have gcc installed on my PC. Synaptic tells me it's there
> and gcc <filename> does what I'd expect ... except that it won't
> compile anything because it throws up an error at
>
> #include <stdio.h>
>
> and a search indicates that there is, indeed, no stdio.h installed
> anywhere.

Try installing libc6-dev.

--
email: echo t.adl...@iypzavs.hj.br | tr a-gh-pq-z t-za-ij-s

Ben Bacarisse

unread,
Jun 3, 2007, 9:42:16 AM6/3/07
to
Ian <ian.g...@btinternet.com> writes:

> Folks, I think this may be a daft question, but ...
>
> I seem to have gcc installed on my PC. Synaptic tells me it's there
> and gcc <filename> does what I'd expect ... except that it won't
> compile anything because it throws up an error at
>
> #include <stdio.h>
>
> and a search indicates that there is, indeed, no stdio.h installed
> anywhere.

On my Ubuntu 7.04:

$ apt-file find /usr/include/stdio.h
libc6-dev: usr/include/stdio.h

Do you have libc6-dev installed?

--
Ben.

Ian

unread,
Jun 3, 2007, 10:10:01 AM6/3/07
to
On 3 Jun, 14:42, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
> Ian <ian.gro...@btinternet.com> writes:

> > and a search indicates that there is, indeed, no stdio.h installed
> > anywhere.
>
> On my Ubuntu 7.04:
>
> $ apt-file find /usr/include/stdio.h
> libc6-dev: usr/include/stdio.h
>
> Do you have libc6-dev installed?

I didn't, but I do know, and am happily Helloworlding like anything.

In my own defence, I still haven't worked out what category they have
stuck that in in Synaptic - I am sure I would have noticed it if it
was in "development" where gcc is ...

Many thanks,

Ian

David Aldred

unread,
Jun 3, 2007, 12:44:29 PM6/3/07
to
Ian wrote:

> In my own defence, I still haven't worked out what category they have
> stuck that in in Synaptic - I am sure I would have noticed it if it
> was in "development" where gcc is ...

There's a metapackage which will install all that's needed for
compile/build - install 'build-essential' and you should be away.

--
David Aldred

badari

unread,
Jun 11, 2007, 1:56:47 AM6/11/07
to

Hi did you find any solution?
Yesterday I installed brand new 7.04 of Ubuntu and wrote the usual
hello world program.
Compiler could not find stdio.h I haven't checked libc6 instalation.
If you have found the solution please let me know

Robert Harris

unread,
Jun 11, 2007, 8:34:36 AM6/11/07
to
The headers are part of the C library. Try installing:

libc6-dev

Robert

Ian

unread,
Jun 11, 2007, 1:28:16 PM6/11/07
to
On 11 Jun, 13:34, Robert Harris <robert.f.har...@blueyonder.co.uk>
wrote:

What I can't understand is why they bother to install gcc without the
headers. What use is that?

Ian


Nix

unread,
Jun 11, 2007, 3:55:42 PM6/11/07
to
On 11 Jun 2007, Ian spake thusly:

> What I can't understand is why they bother to install gcc without the
> headers. What use is that?

It's potentially useful for cross-compilation, and even without that,
for OS-less embedded development.

(But it's true that a compiler targetted at, say, i686-pc-linux-gnu
is useless without the headers for that target, so you'd expect a
dependency...)

--
`... in the sense that dragons logically follow evolution so they would
be able to wield metal.' --- Kenneth Eng's colourless green ideas sleep
furiously

Ian

unread,
Jun 12, 2007, 12:49:09 PM6/12/07
to
On 11 Jun, 20:55, Nix <nix-razor-...@esperi.org.uk> wrote:
> On 11 Jun 2007, Ian spake thusly:
>
> > What I can't understand is why they bother to install gcc without the
> > headers. What use is that?
>
> It's potentially useful for cross-compilation, and even without that,
> for OS-less embedded development.

Indeed. But for how many people are those such fundamental uses of
Ubuntu that it's worth catering for them in the standard install. A
*nix without a C compiler is like a thing without another closely
related thing.

Ian

PS Have been in tedious meetings all day. Analogy generator a bit out
of sorts.


0 new messages