Help!

Ubuntu gcc: where are the headers?


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> UK RSS
Next:  LANs, DHCP, and local name server question  
Author Message
Ian
External


Since: Jun 03, 2007
Posts: 10



PostPosted: Sun Jun 03, 2007 6:12 am    Post subject: Ubuntu gcc: where are the headers?
Archived from groups: uk>comp>os>linux (more info?)

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
Back to top
Ian
External


Since: Jun 03, 2007
Posts: 10



PostPosted: Sun Jun 03, 2007 7:10 am    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 3 Jun, 14:42, Ben Bacarisse <ben.use... RemoveThis @bsb.me.uk> wrote:
> Ian <ian.gro... RemoveThis @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
Back to top
Tweedale
External


Since: Dec 08, 2005
Posts: 29



PostPosted: Sun Jun 03, 2007 1:34 pm    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.adllkhsl.RemoveThis@iypzavs.hj.br | tr a-gh-pq-z t-za-ij-s
Back to top
Ben Bacarisse
External


Since: Jun 10, 2005
Posts: 90



PostPosted: Sun Jun 03, 2007 2:42 pm    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ian <ian.groups.TakeThisOut@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.
Back to top
David Aldred
External


Since: Mar 29, 2005
Posts: 51



PostPosted: Sun Jun 03, 2007 4:44 pm    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
badari
External


Since: Jun 11, 2007
Posts: 1



PostPosted: Mon Jun 11, 2007 5:56 am    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jun 3, 6:12 pm, Ian <ian.gro... RemoveThis @btinternet.com> 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.
>
> 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

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
Back to top
Ian
External


Since: Jun 03, 2007
Posts: 10



PostPosted: Mon Jun 11, 2007 10:28 am    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 11 Jun, 13:34, Robert Harris <robert.f.har....TakeThisOut@blueyonder.co.uk>
wrote:
> badari wrote:
> > On Jun 3, 6:12 pm, Ian <ian.gro....TakeThisOut@btinternet.com> 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.
>
> >> 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
>
> > 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
>
> The headers are part of the C library. Try installing:
>
> libc6-dev

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

Ian
Back to top
Robert Harris
External


Since: Aug 14, 2005
Posts: 166



PostPosted: Mon Jun 11, 2007 12:34 pm    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

badari wrote:
> On Jun 3, 6:12 pm, Ian <ian.gro... RemoveThis @btinternet.com> 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.
>>
>> 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
>
> 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
>
The headers are part of the C library. Try installing:

libc6-dev

Robert
Back to top
Nix
External


Since: Jul 29, 2004
Posts: 680



PostPosted: Mon Jun 11, 2007 8:55 pm    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
Ian
External


Since: Jun 03, 2007
Posts: 10



PostPosted: Tue Jun 12, 2007 9:49 am    Post subject: Re: Ubuntu gcc: where are the headers? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 11 Jun, 20:55, Nix <nix-razor-....TakeThisOut@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.
Back to top
danh



Joined: Oct 29, 2007
Posts: 1



PostPosted: Mon Oct 29, 2007 3:50 pm    Post subject: [Login to view extended thread Info.]

Thanks Ian for posting the question about where /usr/include/stdio.h is, and
for the replies to install libc6-dev.

That worked for me (after i was surprised to find out that there was no
/usr/include/stdio.h).

Now, Ben made a good suggestion to use apt-file to find what package
/usr/include/stdio.h is in.

As it happens, you do have to install apt-file first, but after i installed it,
and tried searching for /usr/include/stdio.h, it couldn't find it.

In fact, on my system, apt-file can't seem to find anything,
including apt-file itself. My version is 2.0.8.2, and it's a perl script.
(My system is very, very new, with only a few packages installed,
most recently libc6-dev, of course.)

If this rings a bell for anybody, please post, and thanks in advance.

dan
Back to top
It_Lg



Joined: Nov 28, 2008
Posts: 1



PostPosted: Mon Dec 08, 2008 4:59 pm    Post subject: Thanks men [Login to view extended thread Info.]

Appreciate it. GOD Bless you.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> UK All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum