Cause of the problem: the
pthread library is not the default library on Linux systems, and you need to use the static library libpthread.a to connect, so you need to link the library when you create a thread using pthread_create() and when you call the pthread_atfork() function to create a fork handler.
add -lpthread parameter
GCC mult-tcp-server. c-o mult-tcp-server. lpthread
mult-tcp-server. c for your source file, don’t forget to add header #include< pthread.h>
Read More:
- undefined reference to `WinMain‘collect2.exe: error: ld returned 1 exit status
- In function `_start’ undefined reference to `main’ error: ld returned 1 exit status
- .. ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make[2]: ***
- Linux GCC compilation error: “collect2: LD returned 1 exit status”
- Collect2.exe: error: LD returned 5 exit status solution
- Collect2: error: LD returned 1 exit status
- Solutions to the problem of collect2: error: LD returned 1 exit status
- collect2: error:ld returned 1 exit status solution
- Php7 compiles collect2: error: LD returned 1 exit status
- About the problem of collect2.exe [error] LD returned 1 exit status in dev!!!
- Solutions to the problem of “collect2.exe: error: LD returned 1” exit “status when writing C + + with vscode
- Error: LTO wrapper failed collect2: error: LD returned 1 exit status
- A solution to [error] LD returned 1 exit status
- Solution to error [error] LD returned 1 exit status in C language
- Solution to dev C + + error [error] LD returned 1 exit status
- ||Error: LD returned 1 exit status | C + + compile time problems
- Error: LD returned 1 exit status appears when developing esp8266 with anxinco IDE
- [Solved] undefined reference to ‘cv::xfeatures2d::SIFT::create(…)’
- Possible causes of [errror] ID returned 1 exit status error in dev C + + Programmer
- The solution of undefined reference to error