LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-29-2005, 12:56 AM   #1
umeshpandey007
LQ Newbie
 
Registered: Jul 2005
Location: Mumbai,India
Distribution: Fedora core 3
Posts: 9

Rep: Reputation: 0
cannot compile c programs


I used gcc to compile my c program.However it gives an error of not including <stdio.h> and other library files.Please guide me.
 
Old 08-29-2005, 01:16 AM   #2
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
What exactly is the error? Did you include stdio?
 
Old 08-29-2005, 01:19 AM   #3
umeshpandey007
LQ Newbie
 
Registered: Jul 2005
Location: Mumbai,India
Distribution: Fedora core 3
Posts: 9

Original Poster
Rep: Reputation: 0
yes i included <stdio.h> and <conio.h> in my c program.I used this statement in the program

#include <stdio.h>
#include <conio.h>

error:stdio.h:No such file or directory
 
Old 08-29-2005, 01:23 AM   #4
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Interesting, what if you add the "-I /usr/include" option to gcc?
 
Old 08-29-2005, 01:37 AM   #5
umeshpandey007
LQ Newbie
 
Registered: Jul 2005
Location: Mumbai,India
Distribution: Fedora core 3
Posts: 9

Original Poster
Rep: Reputation: 0
I want to know how to include the c library files in my c program and sucessfully run it.
I had included in my c program as #include <stdio.h>
#include <conio.h>
.I edited my file in vi editor.I would like to know how linux can recognise my c library functions.I am using fedora core 3.Is it that some packages I have not installed.
 
Old 08-29-2005, 12:07 PM   #6
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Try "gcc -I /usr/include -o outfile yourfile"

If that doesn't work, search your system for the file "stdio.h"
 
Old 08-29-2005, 01:42 PM   #7
hydra7
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Rep: Reputation: 0
conio.h is typically NOT used in linux/*nix
 
Old 08-29-2005, 09:19 PM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,114

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
In fact, conio.h is the interface to a DOS console library -- not ANSI C or POSIX at all. Look into ncurses if you're looking for similar functionality on *nix.
 
  


Reply


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
what compile programs to install? provkitir Debian 7 12-29-2004 09:33 AM
how to compile c++ programs in 10.1 official msalimane Mandriva 2 12-07-2004 12:30 PM
how to compile C++ programs in linux m_suman Programming 9 03-28-2004 12:14 PM
Certain programs won't compile thegeekster Linux - Software 2 01-15-2004 06:25 AM
compile programs in c and cpp Manjula.S Linux - Software 2 10-15-2003 01:06 AM


All times are GMT -5. The time now is 06:02 PM.

Main Menu
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