12.11. Threading Libraries
Prev | Chapter 12. Dos and Don'ts | Next

## 12.11. Threading Libraries

The threading library must be linked to the binaries using a special flag `-pthread` on FreeBSD. If a port insists on linking `-lpthread` directly, patch it to use `-pthread`.

### Note:

If building the port errors out with `unrecognized option '-pthread'`, it may be desirable to use `cc` as linker by setting `CONFIGURE_ENV` to `LD=${CC}`. The `-pthread` option is not supported by `ld` directly.

Prev | Up | Next
12.10. Respect `CFLAGS` | Home | 12.12. Feedback

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.