Project

General

Profile

Actions

Bug #2499

closed

Compilation error on Ubuntu/Linaro 4.6.4-6ubuntu2

Added by Alex Afanasyev about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
02/09/2015
Due date:
% Done:

100%

Estimated time:

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?

Actions #1

Updated by Alex Afanasyev about 9 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?

Actions #2

Updated by Davide Pesavento about 9 years ago

Alex Afanasyev wrote:

Should we define this constant in default-compiler-flags.py

Yes, but only for gcc < 4.8

Actions #3

Updated by Alex Afanasyev about 9 years ago

  • Status changed from New to Code review
  • Assignee set to Alex Afanasyev
  • % Done changed from 0 to 100
Actions #4

Updated by Alex Afanasyev about 9 years ago

  • Target version changed from Unsupported to v0.4
Actions #5

Updated by Junxiao Shi about 9 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF