我无法使用命令从 64 位 linux 机器编译为 32 位机器的 c 程序gcc -m32 -Werror a.c -o a
它显示了错误
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.
Run Code Online (Sandbox Code Playgroud)
/usr/include/stdio.h
我在我的机器中检查了 stdio.h,Linux kali 4.19.0-kali4-amd64 #1 SMP Debian 4.19.28-2kali1 (2019-03-18) x86_64 GNU/Linux该行 #include <bits/libc-header-start.h>已包含在内,而在其他 ubuntu 64 位中则不包含该行
#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;
}
Run Code Online (Sandbox Code Playgroud)
sudo apt-get install gcc-multilib
如果这不起作用,
sudo apt update并且sudo apt upgrade(您也可以尝试重新安装标头,然后重新启动)