gpt4 book ai didi

qt - 运行一个简单的Qt程序

转载 作者:行者123 更新时间:2023-12-02 10:44:46 25 4
gpt4 key购买 nike

我已经做了以下操作来运行一个简单的Qt程序:

  • 创建了hello文件夹
  • 创建了hello.cpp程序,如下所示:

  •    #include <QApplication>
    #include <QLabel>

    int main(int argc, char* argv[])
    {
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello...");
    label->show();
    return app.exec();
    }

  • qmake -project
  • Ran qmake hello.pro --->在这里,我得到Makefile
  • 运行'make',在这里,我得到类似这样的东西,除非我停止它,否则它似乎会继续进行:

  • c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello make -f Makefile.hello make[1]: Entering directory /c/Users/Ola/Desktop/hello'
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell
    o.pro -o Makefile.hello.hello
    make -f Makefile.hello.hello
    make[2]: Entering directory
    /c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello make -f Makefile.hello.hello.hello make[3]: Entering directory /c/Users/Ola/Desktop/hello'
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell
    o.pro -o Makefile.hello.hello.hello.hello
    make -f Makefile.hello.hello.hello.hello
    make[4]: Entering directory
    /c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello.hello make[5]: Entering directory /c/Users/Ola/Desktop/hello'
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell
    o.pro -o Makefile.hello.hello.hello.hello.hello.hello
    make -f Makefile.hello.hello.hello.hello.hello.hello
    make[6]: Entering directory
    /c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello.hello.hello.hello make[6]: * [sub-hello-pro-make_default] Interrupt make[5]: * [sub-hello-pro-make_default] Interrupt make[4]: * [sub-hello-pro-make_default] Interrupt make[3]: * [sub-hello-pro-make_default] Interrupt make[2]: * [sub-hello-pro-make_default] Interrupt make[1]: * [sub-hello-pro-make_default] Interrupt make: * [sub-hello-pro-make_default] Interrupt



    如何运行该程序?

    谢谢。

    最佳答案

    使用随Qt安装软件包一起安装的Qt命令提示符。然后,不要使用make,而要使用mingw32-make

    这个对我有用。

    关于qt - 运行一个简单的Qt程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12339465/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com