Results 1 to 5 of 5
Hi,
I am just starting to resume my programming - so have come to the world of Linux because its great.
Anyway, i have a C file i am trying ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-11-2005 #1Just Joined!
- Join Date
- Oct 2005
- Location
- Cambridge, UK
- Posts
- 7
Searching for function definitions in kernel header files
Hi,
I am just starting to resume my programming - so have come to the world of Linux because its great.
Anyway, i have a C file i am trying to compile and it contains includes for headers...
Also, its giving me an error because i havent included the header declaration for a function perror() and also printf(). I want to search the header files for these function declerations so i can include them.Code:#include <string.h> #include <stdlib.h> #include <time.h> #include <sys/resource.h> #include <unistd.h>
My question is, where are these files located - or do i have to go and get them from somewhere ? I have done a find for these files but cant find them!
Thanks in advance
Ringo
PS I have just installed mandrake 10.1
- 10-11-2005 #2Linux Newbie
- Join Date
- Oct 2004
- Posts
- 158
You may have not installed it correctly. Several things are not correct.
printf() is in <stdio.h> But - it does not have to be declared as a function
prototype - per standard C99. Your code should compile anyway.
perror() is in <stdlib.h> which you included.
Are you sure you're not seeing link errors instead? Are you in an ARM environment?
1. show us your gcc command line
2. give us all the screen output from gcc
- 10-11-2005 #3Just Joined!
- Join Date
- Oct 2005
- Location
- Cambridge, UK
- Posts
- 7
You may recognise this jim....
Pretty simple - do i need to set my path up correctly ?Code:gcc -Wall revtest.c -o revtest revtest.c: In function `main': revtest.c:108: warning: implicit declaration of function `perror' revtest.c:114: warning: implicit declaration of function `printf'
Thanks
Ringo
- 10-11-2005 #4Just Joined!
- Join Date
- Oct 2005
- Location
- Cambridge, UK
- Posts
- 7
Should these files be in or around /usr/src/linux ?
Because they arent!
Thanks
Ringo
- 10-12-2005 #5Linux User
- Join Date
- Jul 2004
- Location
- Poland
- Posts
- 368
They should reside in /usr/include. Do you have something like glibc-devel package installed? But I think these files are there, otherewise the C preprocessor would complain.
Originally Posted by ringo22 "I don't know what I'm running from
And I don't know where I'm running to
There's something deep and strange inside of me I see"


Reply With Quote
