CPlusPlusHowToProgram11e icon indicating copy to clipboard operation
CPlusPlusHowToProgram11e copied to clipboard

fig17_12 link error

Open fancyerii opened this issue 7 months ago • 0 comments

 g++-13 -std=c++20 async.cpp -o async
/usr/bin/ld: /tmp/ccBfmpl3.o: in function `id[abi:cxx11]()':
async.cpp:(.text+0x8c): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::thread::id)'
collect2: error: ld returned 1 exit status

It seems the problem of missing thread header. When I add this header, it works.

#include <thread>

fancyerii avatar Mar 29 '25 06:03 fancyerii