1. 程式人生 > >QT5.0.1在Windows下 出現QApplication: No such file or directory 問題的解決辦法

QT5.0.1在Windows下 出現QApplication: No such file or directory 問題的解決辦法

 
#include <QApplication>
#include <QPushButton>
#include <QLabel>
#include <QHBoxLayout>


int main(int argc, char **argv)

{

    QApplication app(argc, argv);



    QWidget *pMainWidget = new QWidget;

    QHBoxLayout *pBoxLayout = new QHBoxLayout;



    QLabel *pLabel = new QLabel(pMainWidget);

    pLabel->setText("Hello World!");



    QPushButton *pQuitButton = new QPushButton(pMainWidget);

    pQuitButton->setText("Quit Qt!");



    pBoxLayout->addWidget(pLabel);

    pBoxLayout->addWidget(pQuitButton);



    QSize windowSize(300,200);

    pMainWidget->resize(windowSize);

    pMainWidget->show();



    QObject::connect(pQuitButton,SIGNAL(clicked()),pMainWidget,SLOT(close()));



    return app.exec();



}

相關推薦

QT5.0.1在Windows 出現QApplication: No such file or directory 問題的解決辦法

  #include <QApplication> #include <QPushButton> #include <QLabel> #include <QHBoxLayout> int main(int argc, char **argv) {

PyCharm ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory 解決辦法

圖片 object shared 8.0 body har error err cto PyCharm ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or d

ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory 解決辦法

object init ror 文件 module libmysql 找到 str 軟連接 >>> import MySQLdbTraceback (most recent call last): File "<stdin>", line

gcc編譯報錯 checking whether the C compiler works... no 中的 error trying to exec 'cc1': execvp: No such file or directory解決辦法

1 首先檢查報錯原因是execvp: No such file or directory 因此要將/etc/profile的export PATH指向gcc的lib路徑中的cc1檔案 例如我的cc1檔案在/usr/lib64/gcc/x86_64-suse-linux/4.8/ 則輸出 export P

-bash: sbin/lua: No such file or directory解決辦法

說明 有時候,可執行檔案Lua 明視訊記憶體在,執行時會提示-bash: sbin/lua: No such file or directory。首先想到的應該是依賴的動態連結庫缺少。 原因 首先檢視lua所依賴的動態連結庫有哪些 $ ldd sbin/lu

Linux: find命令 ‘/proc/xxxx/task/xxxx/fd/y’: No such file or directory 解決辦法

問題描述: find命令查詢系統中大於50M的檔案時,有幾行報錯: No such file or directory [email protected]:~# find / -size +50M /proc/kcorefind: ‘/proc/6377/task

fatal error: alsa/asoundlib.h: No such file or directory 解決辦法

最近在ROS裡編譯呼叫了科大訊飛SDK的語音包,編譯時報了錯誤 fatal error: alsa/asoundlib.h: No such file or directory, 找不到asoundlib.h檔案,解決辦法如下,直接apt安裝那個庫就行了 sudo a

/usr/bin/env: bash: No such file or directory 解決辦法

The problem's cause was that Git on Windows converted the line endings of gradlew from Unix style (LF) to Windows style (CRLF). You can t

ltdl.h: No such file or directory解決辦法

簡介 系統沒有安裝libltdl開發庫 解決方法 如果在ubunt作業系統中,只需安裝: apt install libltdl3-dev 如果在centos作業系統中,只需安裝: yum

mingw用gcc編譯c檔案出現no such file or directory解決方法

c檔案直接拖進cmd時地址是對的,但gcc不認空格,所以要把路徑當做所有空格都去掉或改成“—”,這樣它就能直接發現檔案了,這時在cmd中編寫:gcc F:\new.c -o F:\new.exe   ,就會出現new.e

qt5中的QApplication: No such file or directory問題

出現原因:Qt5裡不再用QtGui模組,而是使用QtWidgets模組。解決方法: 在.pro里加上QT += widgets 實測 greaterThan(QT_MaJOR_VERSION,4) : QT+= widgets 或者 QT+= widgets qt4

Qt5qapplication no such file or directory

最近開始學Qt,對照著霍亞飛的《Qt Creator 快速入門》第二版,裡面用的是Qt4,但是我直接裝了qt opensource後發現時Qt5,就在Qt5的環境上學習。 在第二章2.3節,自己編寫一個main函式時執行出現qapplication no such file

error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory解決

make scp AR object normal memcache window 2.0 HA 我是從其他服務器scp來的memcached(~~~整個文件夾的那種,windows用多了的後遺癥) 在準備運行 ./memcached -d -u root -l loca

Ubuntu fatal error: Python.h: No such file or directory 解決方法

error ID apt overflow AC python3 TE cto fat 參考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such f

hdfs dfs -ls後出現No such file or directory解決

原因是因為-ls預設目錄是在hdfs檔案系統的/user/使用者名稱(使用者名稱就命令列@符號前面的那個東西),但是你的hdfs系統內沒有這個資料夾,所以會顯示No such file or directory。 所以你需要在hdfs檔案系統內建立 [email protected

DebianCannot set LC_CTYPE to default locale: No such file or directory解決方法

把語言環境變數改為英文 將Ubuntu系統語言環境改為英文的en_US.UTF-8 檢視當前系統語言環境 locale 編輯配置檔案。將zh_US.UTF-8改為en_US.UTF-8。zh改為en sudo nano /etc/default/locale

libopencv_shape.so.3.0: cannot open shared object file: No such file or directory 解決筆記

進入目錄:/etc/ld.so.conf.d 建立:opencv.conf 新增:/opt/opencv-3.0.0/build/lib 執行:ldconfig DETAIL: (1)ldd dlsd檢視缺少哪些庫:如圖,缺少opencv相關的庫。(2)locate libopencv_imgcod

MacBook-bash: cd: /Applications/Android: No such file or directory解決方案

前言        當我想在Android studio的Terminal中敲相關gradlew命令時,一直報[bash: gradlew: command not found]錯誤,很是心塞,故翻閱一些相關資料解決此問題,所幸是成功了,在此做一下筆記

也談Qt經典出錯資訊之QApplication: No such file or directory

這個問題似乎是老生常談了,好多朋友也都就這個問題做了探究,這裡我說說我的看法,以及對於初學者而言,如何快速定位問題,快速解決問題, 下面是網友zhu的完整闡述: 這個出錯資訊一般是新手在編譯Qt4第一個應用”Hello,World”的時候,翻開Qt程式設計的第一個例子。都

linux/dev/dsp:No such file or directory解決方法

寫了一個需要通過dsp進行音訊操作的小程式,執行時卻提示/dev/dsp:No such file or directory $ls /dev目錄下並沒有dsp這個檔案解決方法很簡單: $sud