0

I'm trying to compile a program that I've been able to compile on several other Debian environments with no issues using the C11 <threads.h> library on a relatively fresh install of Debian Bullseye with "gcc (Debian 10.2.1-6) 10.2.1 20210110" installed

with the command

gcc -o <progname> -O3 -Wall -Wextra -std=c11 -lpthread <sourcefile>

and I'm getting a string of linker errors in the form of undefined reference to 'mtx_unlock' as well as mtx_lock mtx_init thrd_create etc.

But I'm not getting an error saying the threads.h file is absent. I tried removing the -lpthread argument from the compilation command but this changed nothing.

What is going wrong?

Willis Hershey
  • 1,520
  • 4
  • 22

1 Answers1

0

The correct command line parameter seems to be -pthread without the l.

Jens Gustedt
  • 76,821
  • 6
  • 102
  • 177