mbcrawfo / GenericMakefile

A generic makefile for use with small/medium C and C++ projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding pthread

mspiropali opened this issue · comments

I have a hard time adding pthread. I add -pthread to COMPILE_FLAGS, as well as -lpthread to LD_FLAGS, but the thread functions aren't recognised.

Sorry for the delay answering, I assume you probably found your answer long ago. For the sake of anyone else stumbling across this question, all that's needed to link against a library is is to add it to LINK_FLAGS in the Makefile. In this case you'd set LINK_FLAGS = -lpthread.