Konvertierte ein Qt-Projekt in ein VC++-Projekt – unaufgelöste externe SymboleC++

Programme in C++. Entwicklerforum
Guest
 Konvertierte ein Qt-Projekt in ein VC++-Projekt – unaufgelöste externe Symbole

Post by Guest »

Warum kann ich mein Projekt nicht erstellen und ausführen? Ich habe die erforderlichen .lib-Dateien zu den Linker-Eingabeeigenschaften hinzugefügt, das Qt-Verzeichnis „include“ zu zusätzlichen Eingabeordnern hinzugefügt, die .dll-Dateien in den Projektordner kopiert usw. Visual Studio beschwert sich immer noch über nicht aufgelöste externe Symbole. Was soll ich tun?

Die Datei main.cpp sieht so aus:

Code: Select all

#include 
#include 

int main(int argc, char* argv[]) {

QApplication app(argc, argv);
QLabel* label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
Die .pro-Datei sieht so aus:

Code: Select all

######################################################################
# Automatically generated by qmake (3.1) Tue Jan 17 00:13:06 2017
######################################################################

QT += core gui widgets

TEMPLATE = app
TARGET = hello
INCLUDEPATH += .

# Input
SOURCES += main.cpp
Die Fehlerliste ist unten:

Code: Select all

1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QApplication::QApplication(int &,char * *,int)" (__imp_??0QApplication@@QEAA@AEAHPEAPEADH@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QApplication::~QApplication(void)" (__imp_??1QApplication@@UEAA@XZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl QApplication::exec(void)" (__imp_?exec@QApplication@@SAHXZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QWidget::show(void)" (__imp_?show@QWidget@@QEAAXXZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QLabel::QLabel(class QString const &,class QWidget *,class QFlags)" (__imp_??0QLabel@@QEAA@AEBVQString@@PEAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QLabel::~QLabel(void)" (__imp_??1QLabel@@UEAA@XZ) referenced in function "public: virtual void * __cdecl QLabel::`scalar deleting destructor'(unsigned int)" (??_GQLabel@@UEAAPEAXI@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::actionEvent(class QActionEvent *)" (?actionEvent@QWidget@@MEAAXPEAVQActionEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::changeEvent(class QEvent *)" (?changeEvent@QLabel@@MEAAXPEAVQEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::closeEvent(class QCloseEvent *)" (?closeEvent@QWidget@@MEAAXPEAVQCloseEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::contextMenuEvent(class QContextMenuEvent *)" (?contextMenuEvent@QLabel@@MEAAXPEAVQContextMenuEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl QWidget::devType(void)const " (?devType@QWidget@@UEBAHXZ)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dragEnterEvent(class QDragEnterEvent *)" (?dragEnterEvent@QWidget@@MEAAXPEAVQDragEnterEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dragLeaveEvent(class QDragLeaveEvent *)" (?dragLeaveEvent@QWidget@@MEAAXPEAVQDragLeaveEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dragMoveEvent(class QDragMoveEvent *)" (?dragMoveEvent@QWidget@@MEAAXPEAVQDragMoveEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dropEvent(class QDropEvent *)" (?dropEvent@QWidget@@MEAAXPEAVQDropEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::enterEvent(class QEvent *)" (?enterEvent@QWidget@@MEAAXPEAVQEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QLabel::event(class QEvent *)" (?event@QLabel@@MEAA_NPEAVQEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::focusInEvent(class QFocusEvent *)" (?focusInEvent@QLabel@@MEAAXPEAVQFocusEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QLabel::focusNextPrevChild(bool)" (?focusNextPrevChild@QLabel@@MEAA_N_N@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::focusOutEvent(class QFocusEvent *)" (?focusOutEvent@QLabel@@MEAAXPEAVQFocusEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public:  virtual bool __cdecl QWidget::hasHeightForWidth(void)const " (?hasHeightForWidth@QWidget@@UEBA_NXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl QLabel::heightForWidth(int)const " (?heightForWidth@QLabel@@UEBAHH@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::hideEvent(class QHideEvent *)" (?hideEvent@QWidget@@MEAAXPEAVQHideEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::initPainter(class QPainter *)const " (?initPainter@QWidget@@MEBAXPEAVQPainter@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::inputMethodEvent(class QInputMethodEvent *)" (?inputMethodEvent@QWidget@@MEAAXPEAVQInputMethodEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class QVariant __cdecl QWidget::inputMethodQuery(enum Qt::InputMethodQuery)const " (?inputMethodQuery@QWidget@@UEBA?AVQVariant@@W4InputMethodQuery@Qt@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::keyPressEvent(class QKeyEvent *)" (?keyPressEvent@QLabel@@MEAAXPEAVQKeyEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::keyReleaseEvent(class QKeyEvent *)" (?keyReleaseEvent@QWidget@@MEAAXPEAVQKeyEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::leaveEvent(class QEvent *)" (?leaveEvent@QWidget@@MEAAXPEAVQEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl QLabel::metaObject(void)const " (?metaObject@QLabel@@UEBAPEBUQMetaObject@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl QWidget::metric(enum QPaintDevice::PaintDeviceMetric)const " (?metric@QWidget@@MEBAHW4PaintDeviceMetric@QPaintDevice@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class QSize __cdecl QLabel::minimumSizeHint(void)const " (?minimumSizeHint@QLabel@@UEBA?AVQSize@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::mouseDoubleClickEvent(class QMouseEvent *)" (?mouseDoubleClickEvent@QWidget@@MEAAXPEAVQMouseEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::mouseMoveEvent(class QMouseEvent *)" (?mouseMoveEvent@QLabel@@MEAAXPEAVQMouseEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::mousePressEvent(class QMouseEvent *)" (?mousePressEvent@QLabel@@MEAAXPEAVQMouseEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::mouseReleaseEvent(class QMouseEvent *)" (?mouseReleaseEvent@QLabel@@MEAAXPEAVQMouseEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::moveEvent(class QMoveEvent *)" (?moveEvent@QWidget@@MEAAXPEAVQMoveEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QWidget::nativeEvent(class QByteArray const &,void *,long *)" (?nativeEvent@QWidget@@MEAA_NAEBVQByteArray@@PEAXPEAJ@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class QPaintEngine * __cdecl QWidget::paintEngine(void)const " (?paintEngine@QWidget@@UEBAPEAVQPaintEngine@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::paintEvent(class QPaintEvent *)" (?paintEvent@QLabel@@MEAAXPEAVQPaintEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl QLabel::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QLabel@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl QLabel::qt_metacast(char const *)" (?qt_metacast@QLabel@@UEAAPEAXPEBD@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual class QPaintDevice * __cdecl QWidget::redirected(class QPoint *)const " (?redirected@QWidget@@MEBAPEAVQPaintDevice@@PEAVQPoint@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::resizeEvent(class QResizeEvent *)" (?resizeEvent@QWidget@@MEAAXPEAVQResizeEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl QWidget::setVisible(bool)" (?setVisible@QWidget@@UEAAX_N@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual class QPainter * __cdecl QWidget::sharedPainter(void)const " (?sharedPainter@QWidget@@MEBAPEAVQPainter@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "protected:  virtual void __cdecl QWidget::showEvent(class QShowEvent *)" (?showEvent@QWidget@@MEAAXPEAVQShowEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class QSize __cdecl QLabel::sizeHint(void)const " (?sizeHint@QLabel@@UEBA?AVQSize@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::tabletEvent(class QTabletEvent *)" (?tabletEvent@QWidget@@MEAAXPEAVQTabletEvent@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::wheelEvent(class QWheelEvent *)" (?wheelEvent@QWidget@@MEAAXPEAVQWheelEvent@@@Z)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post