Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-21-2007, 08:00 PM   #1
LQ Newbie
Registered: May 2007
Location: TN
Distribution: Kubuntu 7.10
Posts: 18

Rep: Reputation: 0
gcc problem: standard libs not found

Hi.. I'm a beginner with Linux and C programming, but I have a fairly huge problem..

I started out with this code:
#include <stdio.h>

int main()
    printf( "I am alive! Beware.\n" );
    return 0;
It looks fine, and compiled on cygwin, but in Kubuntu 7.10, it gives this error:
 >> gcc test.c
test.c:1:19: error: stdio.h: No such file or directory
test.c: In function ‘main’:
test.c:5: warning: incompatible implicit declaration of built-in function ‘printf’
So, I searched the forums and tried 'locate stdio.h' and it returned something in perl called nostdio.h, but not what I wanted. So I tried looking for iostream.h.. nothing at all that time. I'm confused. I thought having gcc on the computer would mean the libs would be there. Why are they not, and how do I get them? Also, I checked Adept Manager and it has a bunch of different gcc things, a few of which I have installed, like gcc, then gcc3.2 or something. It's weird...

Anyone out there know how to make sense of this?


EDIT: Blah.. I found the package for libc++-dev and installed it finally. The only one so far which required the CD. Things work now. :P

Last edited by Tzolkin; 10-21-2007 at 08:45 PM. Reason: Update
Old 10-22-2007, 01:03 AM   #2
LQ Newbie
Registered: Oct 2007
Location: Karachi, Pakistan
Distribution: Slackware-12.0
Posts: 7

Rep: Reputation: 0
I never expect variants of Ubuntu to ship with development libraries. I don't have a Linux system at hand, but I think you need to have libstd installed.

If you run find / -type f -name 'stdio.h' -print, you will be able to establish whether the standard C library is present on your system or not.
Old 10-22-2007, 02:59 AM   #3
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,421

Rep: Reputation: 199Reputation: 199
hmm, sounds like you will need to download the development packages
(which will have all the header files),
strange though you have the compiler but no header files????

go into synaptic and look under development.
Old 10-22-2007, 06:32 AM   #4
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
You need the build-essentials package, get it via Synaptic or apt-get.
Old 10-23-2007, 03:24 PM   #5
LQ Newbie
Registered: May 2007
Location: TN
Distribution: Kubuntu 7.10
Posts: 18

Original Poster
Rep: Reputation: 0
I installed the dev packages. Programs compile now, heh. I still think it's weird that gcc would be installed but not the header files. :P

Old 11-29-2007, 06:41 PM   #6
Registered: Nov 2007
Location: Vancouver
Distribution: Ubuntu 7.10
Posts: 43

Rep: Reputation: 15
I am having the same problem and found several references to the proper resolution. I have Ubuntu 7.04 running on a desktop machine and so far everything seems to work. This missing stdio.h file, etc. seems to be a fact of life with this, and maybe other, distro. However, on my machine, if I run

sudo apt-get install build-essential

I get the following errors:

------------ Start of quote

Some packages could not be installed. This may mean you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or moved out of Incoming.

Since you only requested a single operation it is extremely likely that the package is simply not installable and a bug report against that package should be filed. The following information may help resolve the situation:

The following packages have unmet dependencies:
build-essential: Depends: libc6-dev but it is not going to be installed or libc-dev
Depends: g++ (>= 4:4.1.1) but it is not going to be installed
Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed

E: Broken packages

------------------ End quote

So... does anyone know how to proceed on this? '

This question would probably be better asked on the Distributions:Ubuntu forum, but this thread already existed.


Peatmoss /Alleria

I've redirected this to another forum since it doesn't really belong here. Sorry for the messup...


Last edited by Peatmoss; 12-01-2007 at 02:35 PM. Reason: Redirected this question to the Ubuntu forum
Old 04-02-2008, 10:13 AM   #7
LQ Newbie
Registered: Apr 2008
Posts: 1

Rep: Reputation: 0
Try installing the g++
and then compile ur c programs on gcc.
It will work I suppose.
Prior to g++ installation we had these probs.
Once g++ was put in the files like stdio.h etc came in with the g++ lib
& dependencies...
good luck try. it....
May be this solution may not be upto the mark for many!


error, found, gcc, libraries

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE Libs not found jonlake Linux - Software 9 02-06-2005 01:57 PM
Setting up includes and libs for gcc Keenan Linux - Software 1 12-12-2004 12:33 PM
Xless LiveCD with GCC and libs stalefish85 Linux - Distributions 2 11-05-2004 07:56 AM
Problem installing DCTC (Qt libs not found). brynjarh Linux - Newbie 1 05-25-2004 05:44 PM
qt-libs not found niklasw19 Programming 12 11-24-2003 03:17 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration