undefined reference to `pthread_join code example Example: undefined reference to `pthread_create' c++ add_compile_options(-pthread)