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
Try installing libc6-dev.
--
email: echo t.adl...@iypzavs.hj.br | tr a-gh-pq-z t-za-ij-s
> 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.
> > 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
> 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
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
libc6-dev
Robert
What I can't understand is why they bother to install gcc without the
headers. What use is that?
Ian
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
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.