Explicit link to pthread

Fixes:

    $ LC_ALL=C make                                                                                                      
    [ 50%] Linking CXX executable teller                      
    /usr/bin/ld: CMakeFiles/teller.dir/teller.cc.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'         
    /usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line             
    collect2: error: ld returned 1 exit status    
    make[2]: *** [CMakeFiles/teller.dir/build.make:103: teller] Error 1                                                                                                                                                                     
    make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/teller.dir/all] Error 2                                                                                                                                                               
    make: *** [Makefile:103: all] Error 2
This commit is contained in:
Étienne BERSAC 2022-08-22 09:13:26 +02:00 committed by GitHub
parent dc82ea2874
commit 5213ea113c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ set(CMAKE_CXX_EXTENSIONS ON)
#target_link_libraries(support PUBLIC -lh2o-evloop -lssl -lcrypto Threads::Threads)
add_executable(teller teller.cc )
target_link_libraries(teller -lpcaudio)
target_link_libraries(teller -lpcaudio -lpthread)
#enable_testing()
#add_test(testname testrunner)