在qt 5.8中编译程序时出错

时间:2017-02-20 10:25:14

标签: qt qt5.8

在Windows 10 64位的qt 5.8中运行程序时出现此错误。如何解决这个问题。

我的.pro文件

00:43:14: Running steps for project untitled1...
00:43:16: Starting: "G:\IDE\Qt5.8.0\5.8\mingw53_32\bin\qmake.exe" "G:\Qt Projects\untitled1\untitled1.pro" -spec win32-g++ "CONFIG+=qml_debug"
MAKEFILE_GENERATOR variable not set as a result of parsing : untitled1.pro. Possibly qmake was not able to find files included using "include(..)" - enable qmake debugging to investigate more.
00:43:32: The process "G:\IDE\Qt5.8.0\5.8\mingw53_32\bin\qmake.exe" exited with code 3.
Error while building/deploying project untitled1 (kit: Desktop Qt 5.8.0 MinGW 32bit)
When executing step "qmake"
00:43:32: Elapsed time: 00:18.

标头文件

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H

main.cpp文件

#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}

mainwindow.cpp文件

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

mainwindow.ui文件

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>800</width>
    <height>480</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget"/>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
 <connections/>
</ui>

请帮我解决这个问题。感谢

0 个答案:

没有答案