Bugzilla – Bug 1693
Compile error on Mountain Lion (10.8)
Last modified: 2013-06-16 13:57:19 UTC
Created attachment 1606 [details] Patch When compiling ns-3 on Mac (Mountain Lion) with Mac ports g++ version 4.7 I encountered the following error: 16:11:40 runner ['g++-mp-4.7', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '../src/fd-net-device/model/fd-net-device.cc', '-c', '-o', 'src/fd-net-device/model/fd-net-device.cc.1.o'] ../src/fd-net-device/helper/creator-utils.cc: In function 'void ns3::SendSocket(const char*, int, int)': ../src/fd-net-device/helper/creator-utils.cc:60:3: error: 'strerror' was not declared in this scope ../src/fd-net-device/helper/creator-utils.cc:74:3: error: 'strerror' was not declared in this scope ../src/fd-net-device/helper/creator-utils.cc:78:3: error: 'strerror' was not declared in this scope ../src/fd-net-device/helper/creator-utils.cc:170:3: error: 'strerror' was not declared in this scope Waf: Leaving directory `/Users/buildbot/ns-3/ns-3-dev/build' Build failed -> task in 'ns3-fd-net-device' failed (exit status 1): {task 4452574800: cxx creator-utils.cc -> creator-utils.cc.1.o} ['g++-mp-4.7', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '../src/fd-net-device/helper/creator-utils.cc', '-c', '-o', 'src/fd-net-device/helper/creator-utils.cc.1.o'] According to http://en.cppreference.com/w/cpp/string/byte/strerror the std::strerror is defined in <cstring> which was not included in the creator-utils.cc file. Adding the include fixed the problem, see attached patch. All the best, Morten
fixed in 9825:c67e13985be0
*** Bug 1699 has been marked as a duplicate of this bug. ***