簡體   English   中英

無法使用QT編譯C ++

[英]Can't compile C++ with QT

我正在嘗試從qt.io編譯一段示例c ++代碼:

#include <QApplication>

int main(int argc, char **argv){
  QApplication app (argc, argv);
  return app.exec();
}

然后我做了qmake 使用包含以下內容的qt.pro:

TEMPLATE += app
QT += gui declarative
SOURCES += qt.cpp

當我做一個make它給出以下錯誤:

g++ -Wl,-O1 -o qt qt.o    -L/usr/lib64/qt4 -lQtDeclarative -lQtGui -L/usr/lib64/qt4 -lQtCore -lpthread
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQtDeclarative
collect2: error: ld returned 1 exit status
Makefile:102: recipe for target 'qt' failed
make: *** [qt] Error 1

我正在使用funtoo linux

根據AMA的評論,我從qt.pro中刪除了聲明式。 這樣就解決了問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM