The following is my 1st multi-threaded program. But while it was compiled, there is a linking error. The part of the error message:
std::thread::thread<void (&)(int), int&>(void (&)(int), int&):
test.cpp (.text._ZNSt6threadC2IRFviEJRiEEEOT_DpOT0_[_ZNSt6threadC5IRFviEJRiEEEOT_DpOT0_]+0x33): undefined reference pthread_create
collect2: error ld return 1
#include<thread>
void f(int i) {}
int main() {
std::thread t(f, 1);
t.join();
return 0;
}