0

I have encountered an error on Linux while using Posix threads with Code runner on VS Code- an error of undefined reference to pthread_create();

starball
  • 20,030
  • 7
  • 43
  • 238

1 Answers1

0

To fix it please add -pthread argument in code runner settings.json:

    "cpp": "cd $dir && g++ $fileName -pthread -o $fileNameWithoutExt && 
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 16 '22 at 17:09