undefined reference to `pthread_create' collect2: error: ld returned 1 exit status code example
Example 1: undefined reference to `pthread_create' c++
add_compile_options(-pthread)
Example 2: undefined reference to `pthread_create' c++
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")