how to compile semaphore.h in terminal code example Example: how to compile semaphore.h in terminal gcc main.c -o main -lpthread -lrt