From: Aurelien Jacobs Date: Wed, 17 Sep 2014 15:22:14 +0000 (+0200) Subject: Usage of std::thread requires linking with appropriate system thread library. X-Git-Tag: pulseview-0.3.0~537 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=2b76309a072d2493ee1b5293955b72abfd84b8be Usage of std::thread requires linking with appropriate system thread library. This fixes the following link error (on debian sid, gcc 4.9): Linking CXX executable pulseview /usr/bin/ld: CMakeFiles/pulseview.dir/pv/sigsession.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status CMakeFiles/pulseview.dir/build.make:2844: recipe for target 'pulseview' failed --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fd35b1c..27859b3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,8 @@ endif() find_package(Boost 1.42 COMPONENTS filesystem system REQUIRED) +find_package(Threads REQUIRED) + #=============================================================================== #= System Introspection #------------------------------------------------------------------------------- @@ -318,6 +320,7 @@ link_directories(${Boost_LIBRARY_DIRS}) set(PULSEVIEW_LINK_LIBS ${Boost_LIBRARIES} ${QT_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ) if(STATIC_PKGDEPS_LIBS)