Added #include <process.h> for _beginthreadex