【发布时间】:2016-10-21 05:33:40
【问题描述】:
最近我需要在 ns-3 中做一些网络模拟,但是 ns-3 在 Linux 上工作。所以我在我的 Windows 7 上安装了一个 cygwin,并安装了 'Base'、'Devel' 和 'Python' 模块,就像教程显示的那样。
第一个问题是当我使用命令构建 ns-3 时
./build.py
然后它显示了一些奇怪的东西
$ ./build.py
# Skip NetAnim (platform not supported)
# Build NS-3
Entering directory `./ns-3-dev'
Note: configuring ns-3 without pybindgen
=> /usr/bin/python waf configure
Setting top to : /home/Dell/workspace/ns-3-allinone/ns-3-dev
Setting out to : /home/Dell/workspace/ns-3-allinone/ns-3-dev/build
Checking for 'gcc' (C compiler) : /usr/bin/gcc
Checking for cc version : 5.4.0
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Python is not supported in CygWin environment. Try MingW instead.
最后一行很奇怪,因为它跳过了python检查,但是这一行
'configure' finished successfully (45.850s)
还是出现了。 那我应该忽略它吗?
第二个问题是当构建继续时,类似
[ 966/1741] Compiling src/spectrum/model/aloha-noack-mac-header.cc
../src/wifi/model/dsss-error-rate-model.cc: In static function ‘static double ns3::DsssErrorRateModel::DqpskFunction(double)’:
../src/wifi/model/dsss-error-rate-model.cc:38:54: Error:‘M_PI’ is not declared in this scope.
return ((std::sqrt (2.0) + 1.0) / std::sqrt (8.0 * M_PI * std::sqrt (2.0)))
^
Waf: Leaving directory `/home/Dell/workspace/ns-3-allinone/ns-3-dev/build'
Build failed
显示。所以我搜索了这个问题,发现它可能是由我的 c 编译器引起的。但没有解决办法。
那我该怎么办? (对不起 4 我的英语很差...)
【问题讨论】:
-
检查 CFLAGS 或 CXXFLAGS 是否包含任何限制范围的“-std=..”标志。
-
你能更具体地描述一下吗?我以前从未使用过 cygwin 或 linux...