【发布时间】:2020-09-17 06:40:36
【问题描述】:
我正在尝试将为 linux 编写的 c 代码转换为 windows 的 c 代码。 尝试“制作”时,它会说
函数'fork'的隐式声明
所以我搜索了互联网,发现了这个:What is the closest thing Windows has to fork()? 下载 Cygwin 并安装它并再次尝试“make”,它吐出相同的错误输出。之后,我将我的 c 项目复制到 cygwin 文件夹中,打开“cygwin-terminal”程序并在其中运行“make”,仍然是相同的错误输出。 之后,我将 cygwin bin 文件夹中的“cygwin1.dll”复制到我的项目文件夹中,并将我的 Makefile 更改为
gcc -g -Wall -Wextra -Werror -o test_open cygwin1.dll main.c dictionary.c config.c tools.c
然后在普通终端再次启动'make',但它仍然会吐出隐式声明错误。
你有什么建议吗,接下来我可以尝试什么来编译 fork()?
包括:
#include<sys/types.h>
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<stdbool.h>
#include<stdarg.h>
#include<errno.h>
#include<signal.h>
【问题讨论】:
-
cygwin1.dll
gcc -g -Wall -Wextra -Werror -o test_open cygwin1.dll main.c dictionary.c config.c tools.c的这种用法没有意义。normal terminal是什么意思?为什么不是Cygwin Terminal,有什么不同?你能在那儿重复cygcheck -f /usr/include/unistd.h吗?
标签: c linux windows cygwin fork