gcc or clang can not find header files cannot compile .
this is the error I get when I try to compile c source code,
[jimmy@jimmy-pc ~]$ gcc prog1.c
prog1.c:1:10: fatal error: stdio.h: No such file or directory #include <stdio.h>
^~~~~~~~~
compilation terminated.
[jimmy@jimmy-pc ~]$
looked in /usr/lib64/gcc/x86_64-mandriva-linux-gnu/7.3.0/include/
did not find stdio.h
looked in
/usr/include/c++/7.3.0/tr1/ the stdio.h header there is for c++
do I need to reinstall gcc to get the header files that are missing ?
Edit: You can wait till a developer answers on this forum post which may happen today or may take weeks or you could save a ton of time and ask at #openmandriva-cooker on Freenode IRC. (That is not a criticism of devs it is just the nature of how busy they get.)
Edit2: We like for folks to post code as code in this forum as above in my post. To do so use the </> icon. This does make it easier for people trying to help to be able to tell what is what.
Sorry for the repeated posts, Iâm trying to do several things at the same time.
Another helpful hint is simply to do Internet search of whatever problem you have like in this instance I searched the title of this thread and among other articles is this.
I donât know if that is in any way helpful to your issue but I know developers do this all the time to find out if a problem has been solved or at least encountered elsewhere.
did online search first but found nothing specific , I already have that page bookmarked.
the only thing I find odd is that on this query
lib64gcc1-7.3.0-omv2015,0x86_64
is installed âŚbut on second
libgcc1 is installed and not lib64gcc1 , when I use the rpmdrake to download lib64gcc1 it has a block on it .
I might have to uinstall one and install the other , unless there are all kinds of dependency issues
let cha know what happens.
stdio.h is a very basic include files got C compilation. You might be better trying urpmf --provides stdio.h
Not sure what is going on here. Adding -I<inlcude_file_dir_path> to the command line of gcc will probably fix it.
I searched the entire system , normally it is in /usr/include , but no dice.
I checked open suse on my laptop just out of curiosity and all the correct header files are located there.
the only place I could find stdio.h on machine is /usr/include/c++/7.3.0/tr1/stdio.h
this is for c++ , when I issue the command cpp -v for the c pre processor it lists the paths the for header files
as [jimmy@jimmy-pc ~]$ cpp -v
Using built-in specs.
COLLECT_GCC=cpp
Target: x86_64-mandriva-linux-gnu
Configured with: âŚ/configure --prefix=/usr --libexecdir=/usr/libexec --libdir=/usr/lib64 --with-slibdir=/lib64 --mandir=/usr/share/man --infodir=/usr/share/info --disable-libgcj --with-cloog --with-ppl --enable-cloog-backend=isl --disable-cloog-version-check --disable-isl-version-check --disable-libssp --disable-werror --enable-__cxa_atexit --enable-gold=default --with-plugin-ld=/usr/bin/x86_64-mandriva-linux-gnu-ld --enable-bootstrap --enable-checking=release --enable-gnu-unique-object --with-default-libstdcxx-abi=gcc4-compatible --enable-gnu-indirect-function --with-linker-hash-style=gnu --enable-languages=c,ada,c++,fortran,go,lto,objc,obj-c++ --enable-linker-build-id --enable-plugin --enable-lto --enable-libatomic --enable-threads=posix --enable-shared --enable-static --with-system-zlib --with-bugurl=https://issues.openmandriva.org --host=x86_64-mandriva-linux-gnu --build=x86_64-mandriva-linux-gnu --with-cpu=generic --with-arch_32=i586 --with-multilib-list=m32,m64 --with-multilib-list=m64,m32
Thread model: posix
gcc version 7.3.0 20180125 (OpenMandriva) (GCC)
COLLECT_GCC_OPTIONS=â-Eâ â-vâ â-mtune=genericâ â-march=x86-64â
/usr/libexec/gcc/x86_64-mandriva-linux-gnu/7.3.0/cc1 -E -quiet -v - -mtune=generic -march=x86-64
ignoring nonexistent directory â/usr/lib64/gcc/x86_64-mandriva-linux-gnu/7.3.0/include-fixedâ
ignoring nonexistent directory â/usr/lib64/gcc/x86_64-mandriva-linux-gnu/7.3.0/âŚ/âŚ/âŚ/âŚ/x86_64-mandriva-linux-gnu/includeâ #include ââŚâ search starts here: #include <âŚ> search starts here:
/usr/lib64/gcc/x86_64-mandriva-linux-gnu/7.3.0/include
/usr/local/include
/usr/include
End of search list.
I checked all of them and found nothing âŚI donât think all of the header files were installed .
I will try urpmi task glibc-devel and see what I get
GOT: kernel-release-headers-4.15.15-1-omv2015.0.x86_64
GOT: kernel-rc-headers-4.6.0-0.rc7.1-omv2015.0.x86_64
In order to satisfy the âkernel-headersâ dependency, one of the following packages is needed:
1- kernel-release-headers-4.15.15-1-omv2015.0.x86_64: Linux kernel header files mostly used by your C library (to install)
2- kernel-rc-headers-4.6.0-0.rc7.1-omv2015.0.x86_64: Linux kernel header files mostly used by your C library (to install)
What is your choice? (1-2) 1
To satisfy dependencies, the following packages are going to be installed:
Package Version Release Dist DEpoch Arch
(medium âmain updatesâ)
glibc-devel 2.27 9 omv 2015.0 x86_64
kernel-release-headers 4.15.15 1 omv 2015.0 x86_64
(medium âcontribâ)
task 2.1.2 2 omv 2015.0 x86_64
10MB of additional disk space will be used.
2.9MB of packages will be retrieved.
Proceed with the installation of the 3 packages? (Y/n) y
installing glibc-devel-2.27-9-omv2015.0.x86_64.rpm task-2.1.2-2-omv2015.0.x86_64.rpm kernel-release-headers-4.15.15-1-omv2015.0.x86_64.rpm from /var/cache/urpmi/rpms
Preparing⌠####################################################################################
1/3: task ####################################################################################
2/3: glibc-devel ####################################################################################
3/3: kernel-release-headers
####################################################################################
gcc is now compiling âŚ!!!
thanks for your suggestion Ben âŚ
that command returned " no package found devel"
but then I tried it with glibc-devel and it worked âŚI could not find a glibc-devel when using rpmdrake earlier that was my first line of thinking âŚbut anywho âŚthis worked .
Normally to have glibc-devel you get that because you installed some kernel-release-desktop-devel package (or kernel-release-server-devel). So for what you are doing you should be sure you have that which will install some other package like kernel-release-headers. It will make things easier on you to have these. Now I already have all of these but:
There is a package âtask-develâ which on my system would install 174 packages in addition to the above mentioned packages. Again you want to be sure you have this for what you are trying to do. It will make things easier on you to have these.
I think the last time I did not put the hyphen in the command " task-devel " âŚyou know how everything is case sensitive âŚwell this time it found all that âŚthanks for the info
gonna write some C code now just because I havenât done so in a while âŚoh I found an open source COBOL
compiler to play around with tooâŚgoing down memory lane âŚLOL
have a good one.