diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bb56d9..fd6c96f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,4 +3,9 @@ project(qotd C) set(CMAKE_C_STANDARD 99) -add_executable(qotd main.c quote.c quote.h server.c server.h config.h) \ No newline at end of file +set(CMAKE_THREAD_PREFER_PTHREAD TRUE) +set(THREADS_PREFER_PTHREAD_FLAG TRUE) +find_package(Threads REQUIRED) + +add_executable(qotd main.c quote.c quote.h server.c server.h config.h) +target_link_libraries(qotd Threads::Threads) \ No newline at end of file diff --git a/main.c b/main.c index cb7a0fa..809add9 100644 --- a/main.c +++ b/main.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) { pthread_create(&threadHandle, &attr, (void *(*)(void *)) threadTest, "a"); void * ret; pthread_join(threadHandle, &ret); - puts(ret); + printf("%d", ret); // server(1, 1); return 0;