LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cannot compile c programs (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-compile-c-programs-357978/)

umeshpandey007 08-29-2005 12:56 AM

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.

jrdioko 08-29-2005 01:16 AM

What exactly is the error? Did you include stdio?

umeshpandey007 08-29-2005 01:19 AM

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

jrdioko 08-29-2005 01:23 AM

Interesting, what if you add the "-I /usr/include" option to gcc?

umeshpandey007 08-29-2005 01:37 AM

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.

jrdioko 08-29-2005 12:07 PM

Try "gcc -I /usr/include -o outfile yourfile"

If that doesn't work, search your system for the file "stdio.h"

hydra7 08-29-2005 01:42 PM

conio.h is typically NOT used in linux/*nix

btmiller 08-29-2005 09:19 PM

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.


All times are GMT -5. The time now is 03:42 AM.