If you use "using namespace sf", every SFML class will be accessible in the global scope. This means that both the Thread class and the Thread instance will conflict, because they have the same name. Just change the instance name (MyThread, or whatever).