Semaphores are done differently on Windows than on Unix/Linux. sem.h and the related libraries are Unix. If you're programming Windows then you'll need to know about MSDN. Here's a demo program for semaphores on MSDN:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx