LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 10-21-2007, 09:00 PM   #1
Tzolkin
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:
Code:
#include <stdio.h>

int main()
{
    printf( "I am alive! Beware.\n" );
    getchar();
    return 0;
}
It looks fine, and compiled on cygwin, but in Kubuntu 7.10, it gives this error:
Code:
 >> 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?

--Tzolkin

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 09:45 PM. Reason: Update
 
Old 10-22-2007, 02:03 AM   #2
aakhan
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, 03:59 AM   #3
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,314

Rep: Reputation: 175Reputation: 175
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, 07:32 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,139
Blog Entries: 52

Rep: Reputation: Disabled
You need the build-essentials package, get it via Synaptic or apt-get.
 
Old 10-23-2007, 04:24 PM   #5
Tzolkin
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

--Tzolkin
 
Old 11-29-2007, 07:41 PM   #6
Peatmoss
Member
 
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

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

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

Cheers

Peatmoss /Alleria


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

http://www.linuxquestions.org/questi...ential-603779/

Peatmoss

Last edited by Peatmoss; 12-01-2007 at 03:35 PM. Reason: Redirected this question to the Ubuntu forum
 
Old 04-02-2008, 11:13 AM   #7
bipul
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!
 
  


Reply

Tags
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 02:57 PM
Setting up includes and libs for gcc Keenan Linux - Software 1 12-12-2004 01:33 PM
Xless LiveCD with GCC and libs stalefish85 Linux - Distributions 2 11-05-2004 08:56 AM
Problem installing DCTC (Qt libs not found). brynjarh Linux - Newbie 1 05-25-2004 06:44 PM
qt-libs not found niklasw19 Programming 12 11-24-2003 04:17 PM


All times are GMT -5. The time now is 12:10 AM.

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