Add QT-=gui to your project file.