QT的缺省工程在Windows下无法输出到控制台,给调试带来一定不便。 在.pro中加上: win32:CONFIG += console 后就可以用printf啦!!! 当然还要 #include <stdio.h>