gpt4 book ai didi

c - C代码的Msys编译

转载 作者:太空宇宙 更新时间:2023-11-04 00:08:27 25 4
gpt4 key购买 nike

我不太熟悉编译 C 代码,尤其是在使用 MinGW/Msys 的 Windows 上。这是我的问题。我正在尝试为 Windows 编译开源 M3u8-segmenter C 代码。开源示例都涉及 linux,但我已经在我的 Mac OSX 机器上成功编译了代码,没有任何问题。

在 Windows 上的 Msys 中,./configure 是成功的,但是一旦我执行 Make,我就会收到以下错误。它似乎与 signal.h 包含有关,但我不确定。任何见解将不胜感激。

make[1]: Entering directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Entering directory `/home/install/m3u8-segmenter-master'
gcc -DPACKAGE_NAME=\"m3u8-segmenter\" -DPACKAGE_TARNAME=\"m3u8-segmenter\" -DPAC
KAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"m3u8-segmenter\ 0.3\" -DPACKAGE_BUGREPOR
T=\"http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL=\"http://m3u8-
segmenter.inodes.org\" -DPACKAGE=\"m3u8-segmenter\" -DVERSION=\"0.3\" -DSTDC_HEA
DERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_
H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -
DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE
_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -D
HAVE_STRTOL=1 -I. -Ic:/msys/1.0/local/include -g -O2 -Wall -Wextra -Wdeclar
ation-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstrict-pro
totypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wneste
d-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter-m3u8-
segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8_segme
nter-m3u8-segmenter.o `test -f 'm3u8-segmenter.c' || echo './'`m3u8-segmenter.c
m3u8-segmenter.c: In function 'main':
m3u8-segmenter.c:212:22: error: storage size of 'act' isn't known
m3u8-segmenter.c:413:5: error: implicit declaration of function 'sigaction' [-We
rror=implicit-function-declaration]
m3u8-segmenter.c:413:5: error: nested extern declaration of 'sigaction' [-Werror
=nested-externs]
m3u8-segmenter.c:212:22: error: unused variable 'act' [-Werror=unused-variable]
cc1.exe: all warnings being treated as errors

make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/home/install/m3u8-segmenter-master'
make: *** [all-recursive] Error 1

最佳答案

要在 Windows 上模拟 UNIX,Cygwin 比 this post 指出的 MSys/MinGW 更合适

关于c - C代码的Msys编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13404714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com