EvilZone

Programming and Scripting => C - C++ => : parad0x July 03, 2014, 07:50:03 AM

: [Help][C] Problem with including header files in gcc
: parad0x July 03, 2014, 07:50:03 AM
I was writing dome some sort of C programs, usually basic stuff but when I tried to compile one, it said ]fatal error: stdio.h: No such file or

directory[\b].

Here is my code for that program :
: (C)
#include<stdio.h>

int main(){

printf("Testing....\n");

return 0;

}

Then I remembered something and located the stdio.h file, it gave me /usr/lib/syslinux/com32/include/stdio.h, then once again I edited

my program to look like this
: (C)
#include "/usr/lib/syslinux/com32/include/stdio.h"

int main(){

printf("Testing....\n");

return 0;

}

I thought it would work but then, it gave me another error,  much like the old one.
The error said In file included from try.c:1:0:
/usr/lib/syslinux/com32/include/stdio.h:8:26: fatal error: klibc/extern.h: No such file or directory
 #include <klibc/extern.h>
                          ^
compilation terminated.


The problem is not only with stdio.h header file, but with all others header files that I am trying to use.

My OS is Linux Mint 17 Quiana and I am using gcc compiler to compile all this.

Can anybody tell me how to correct all this??
I really need help with it.
: Re: [Help][C] Problem with including header files in gcc
: Raavgo July 03, 2014, 01:07:09 PM
Well this is odd #include <stdio.h> should work fine, are you sure that gcc is working correctly?
For testing purpose you could copy stdio.h in the directory of your source file and include it with #include "stdio.h".
If this is still not working you got a problem with your compiler, I guess.


: Re: [Help][C] Problem with including header files in gcc
: parad0x July 03, 2014, 02:45:24 PM
I appreciate that you want to help me but you should have really thought that waht you are gonna post is obvious and even I know it. It would be better if you tell me  solution instead of the problem. Btw, +1 for that attitude.
: Re: [Help][C] Problem with including header files in gcc
: Schalla July 03, 2014, 05:22:59 PM
Have you installed the build-essential package?


sudo apt-get install build-essential


I had similar issues also with a frehs installation of LM 17.
: Re: [Help][C] Problem with including header files in gcc
: ArkPhaze July 04, 2014, 04:56:16 AM
Do a reinstall, there's something wrong with your installation.