why bits/libc-header-start.h folder is included in stdio.h header

2

I am unable to compile to c program for 32bit machine from 64bit linux machine using command gcc -m32 -Werror a.c -o a It shows me the error

In file included from a.c:1:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
 #include <bits/libc-header-start.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I check the stdio.h in /usr/include/stdio.h here in my machineLinux kali 4.19.0-kali4-amd64 #1 SMP Debian 4.19.28-2kali1 (2019-03-18) x86_64 GNU/Linux the line #include <bits/libc-header-start.h> is included while in other ubuntu 64 bit this line is not included

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int functionFunction(char *param)
{
    char *localString = "Conjunction Function";
    int localInt = 0xdeadbeef;
    char localString2[10];
    strcpy(localString2,param);
    return 1;
}

int main(int argc, char *argv[])
{
    char *localString = "Main Function";
    int localInt = 0x11223344;
    functionFunction(argv[1]);
    return 0;
}
c
linux
gcc
glibc
asked on Stack Overflow Aug 16, 2019 by Shubham Kumar • edited Aug 16, 2019 by melpomene

1 Answer

2

there are several 'standard' places that are searched for header files.

Amongst them are /usr/include and /usr/local/include and (on x-86-64 machines) /usr/include/x86-64-linux-gnu

When all the needed 'environment' are installed, then the bits directory is found in the /usr/include/x86-64-linux-gnu/ directory, and in that bits directory is the header file: libc-header-start.h header files.

If your on a 64 bit machine and have not installed all the needed 'environment' then you need to install the package: gcc-6-x86-64-linux-gnu

answered on Stack Overflow Aug 16, 2019 by user3629249

User contributions licensed under CC BY-SA 3.0