From eddb5fa91ed6e42e4593604a9cc12e123455d006 Mon Sep 17 00:00:00 2001 From: guanqun Date: Fri, 27 Mar 2015 10:48:26 +0800 Subject: [PATCH] fix the 'sleep_for' missing error on linux platform --- build/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 1a660f81..78efe80e 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -103,6 +103,8 @@ endif () # compiler flags customization (by system) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp") + # "'sleep_for' is not a member of 'std::this_thread'" in gcc 4.7/4.8 + add_definitions( "-D_GLIBCXX_USE_NANOSLEEP=1" ) elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp") # "'sleep_for' is not a member of 'std::this_thread'" in gcc 4.7/4.8