GCC with Cygwin/Win7: missing syscall.h

GCC with Cygwin/Win7: missing syscall.h

本文关键字:missing syscall Win7 with Cygwin GCC      更新时间:2023-10-16

我正在尝试在Windows 7 Cygwin上编译Linux c ++源代码,并收到以下错误:

$ make
getconf: Unrecognized variable `LFS_CFLAGS'
gcc -O3 -Wall -Wextra -g -DVERSION='"v1.1.0"'  -c src/main.c -o src/main.o
src/main.c:10:25: schwerwiegender Fehler: sys/syscall.h: No such file or directory
 #include <sys/syscall.h>
                         ^
Kompilierung beendet.
Makefile:48: recipe for target 'src/main.o' failed
make: *** [src/main.o] Error 1

我用谷歌搜索了这个,但没有任何成功。有什么想法吗?

syscall.h是特定于操作系统的,因此在cygwin下,系统调用特定的东西可能会失败,因此不受支持。

您必须将包含包装在某些

#ifdef下,并编写适当的移植代码以使其在Windows下运行。