Public bug reported:
Binary package hint: gcc-4.4
The following code doesn't compile out of the box with g++ 4.4 on Lucid.
---
#include <thread>
int main(int argc, const char* argv[])
{
std::this_thread::sleep_for(std::chrono::seconds(1));
}
---
$ g++ sleep_for.cpp -o sleep_for -std=c++0x
sleep_for.cpp: In function ‘int main(int, const char**)’:
sleep_for.cpp:5: error: ‘sleep_for’ is not a member of ‘std::this_thread’
If compiled with an additional define _GLIBCXX_USE_NANOSLEEP, then it
compiles and works fine.
$ g++ sleep_for.cpp -o sleep_for -std=c++0x -D_GLIBCXX_USE_NANOSLEEP
The define _GLIBCXX_USE_NANOSLEEP is set from the gcc configuration scripts and
is based on whether nanosleep is supported on the target platform.
This is the case for Ubuntu Lucid, where nanosleep is available.
** Affects: gcc-4.4 (Ubuntu)
Importance: Undecided
Status: New
--
c++0x: error: ‘sleep_for’ is not a member of ‘std::this_thread’
https://bugs.launchpad.net/bugs/608145
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs