问题: error: undefined reference to `QApplication::QApplication(int&, char**, int)'

          error: undefined reference to `QApplication::exec()'

         error: undefined reference to `QApplication::~QApplication()'

解决方案:     注释掉*.pro中 QT   -= gui;

分析:“undefined reference”错误一般是在连接的时候没有找到需要的库而产生的错误。上面的程序就是由于连接时没有指定相应的 Qt 库从而造成了连接错误。这说明是 Makefile 建立得不正确。