Bug #2499
closedCompilation error on Ubuntu/Linaro 4.6.4-6ubuntu2
100%
Description
Originally reported by Anil Jangam on ndnSIM mailing list
I am consistently getting the below compilation error while building ndn-cxx code base.
I am using g++ version - gcc version 4.6.4 (Ubuntu/Linaro 4.6.4-6ubuntu2). I am not sure if this is something to do with compiler version. I found a suggestion to a workaround here: https://bugs.archlinux.org/task/27751
[105/114] Compiling src/util/in-memory-storage-lfu.cpp
[106/114] Compiling src/security/sec-rule-relative.cpp
[107/114] Compiling src/util/time-unit-test-clock.cpp
[108/114] Compiling src/name.cpp
../src/util/time-unit-test-clock.cpp: In member function ‘void ndn::time::UnitTestClock<BaseClock>::advance(const nanoseconds&)’:
../src/util/time-unit-test-clock.cpp:83:3: error: ‘sleep_for’ is not a member of ‘std::this_thread’
../src/util/time-unit-test-clock.cpp: In member function ‘void ndn::time::UnitTestClock<BaseClock>::setNow(const nanoseconds&)’:
../src/util/time-unit-test-clock.cpp:94:3: error: ‘sleep_for’ is not a member of ‘std::this_thread’
Waf: Leaving directory `/home/anilj1/sandbox/nlsrPorting/ndnSIM20/ndn-cxx/build'
Build failed
-> task in 'ndn-cxx' failed (exit status 1):
{task 139666346622352: cxx time-unit-test-clock.cpp -> time-unit-test-clock.cpp.2.o}
['/usr/bin/g++', '-pedantic', '-Wall', '-O2', '-g', '-std=c++0x', '-fPIC', '-include', '/home/anilj1/sandbox/nlsrPorting/ndnSIM20/ndn-cxx/build/ndn-cxx.2', '-I/home/anilj1/sandbox/nlsrPorting/ndnSIM20/ndn-cxx/build', '-I/home/anilj1/sandbox/nlsrPorting/ndnSIM20/ndn-cxx', '-I/home/anilj1/sandbox/nlsrPorting/ndnSIM20/ndn-cxx/build/src', '-I/home/anilj1/sandbox/nlsrPorting/ndnSIM20/ndn-cxx/src', '-I/usr/include', '-DNDEBUG', '../src/util/time-unit-test-clock.cpp', '-c', '-o', '/home/anilj1/sandbox/nlsrPorting/ndnSIM20/ndn-cxx/build/src/util/time-unit-test-clock.cpp.2.o']
Has anyone encountered this error before?
Updated by Alex Afanasyev almost 10 years ago
Somehow, some gcc require _GLIBCXX_USE_NANOSLEEP
to be defined explicitly (http://stackoverflow.com/questions/4438084/stdthis-threadsleep-for-and-gcc)
Should we define this constant in default-compiler-flags.py
or replace std::thread with boost::thread?
Updated by Davide Pesavento almost 10 years ago
Alex Afanasyev wrote:
Should we define this constant in
default-compiler-flags.py
Yes, but only for gcc < 4.8
Updated by Alex Afanasyev almost 10 years ago
- Status changed from New to Code review
- Assignee set to Alex Afanasyev
- % Done changed from 0 to 100
Updated by Alex Afanasyev almost 10 years ago
- Target version changed from Unsupported to v0.4
Updated by Junxiao Shi almost 10 years ago
- Status changed from Code review to Closed