无法使用Cygwin编译netperf 2.7.0

问题描述 投票:0回答:1

不确定这是否是问这个问题的正确位置,但是我在使用Cygwin获取netperf 2.7.0时遇到问题。根据我的阅读,很多人都成功地使用Cygwin来使netperf进行编译,因此我希望丢失一些我忘记安装的库,希望有人对此有所帮助。

这是我进行编译的步骤顺序。

wget https://github.com/HewlettPackard/netperf/archive/netperf-2.7.0.tar.gz
tar -zxvf netperf-2.7.0.tar.gz
cd netperf-netperf-2.7.0
./configure
./make all

以下是错误输出的摘要

mv -f .deps/netcpu_none.Tpo .deps/netcpu_none.Po
gcc     -o netperf.exe netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_none.o  -lm
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: netlib.o:netlib.c:(.text+0x1b46): undefined reference to `__CPU_ZERO'
netlib.o:netlib.c:(.text+0x1b46): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__CPU_ZERO'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: netlib.o:netlib.c:(.text+0x1b57): undefined reference to `__CPU_SET'
netlib.o:netlib.c:(.text+0x1b57): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__CPU_SET'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:305: netperf.exe] Error 1
make[3]: Leaving directory '/home/David Chu/workspace/netperf-netperf-2.7.0/src'
make[2]: *** [Makefile:352: all-recursive] Error 1
make[2]: Leaving directory '/home/David Chu/workspace/netperf-netperf-2.7.0/src'
make[1]: *** [Makefile:277: all-recursive] Error 1
make[1]: Leaving directory '/home/David Chu/workspace/netperf-netperf-2.7.0'
make: *** [Makefile:215: all] Error 2

附有完整的编译日志

compilation.log

提前感谢!

注意:同样的问题也发布在netperf github的项目上,但是该项目的活动很少或没有,所以我也决定在此发布。 https://github.com/HewlettPackard/netperf/issues/41

gcc cygwin
1个回答
0
投票

您可以尝试使用#if 1 // __ GNU_VISIBLE对/usr/include/sys/cpuset.h进行更改,

并从src / netlib.c中的__CPU_ZERO中删除__

© www.soinside.com 2019 - 2024. All rights reserved.