[英]A simple qt program not running with error message saying “segmentation fault”
[英]Running a simple Qt program
我已經完成以下操作來運行一個簡單的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
qmake hello.pro
--->這里我得到Makefile
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] :輸入目錄
/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]:輸入目錄/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]:Enterin g目錄/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]中斷make [5]:* [sub-hello-pro-make_default]中斷make [4]: * [sub-hello-pro-make_default]中斷make [3]:* [sub-hello-pro-make_default]中斷make [2]: * [sub-hello-pro-make_default]中斷make [1 ]:* [sub-hello-pro-make_default]中斷make: * [sub-hello-pro-make_default]中斷
我該如何運行該程序?
謝謝。
使用Qt安裝包安裝的Qt命令提示符。 然后,而不是使用make
使用mingw32-make
。
這個對我有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.