0
我已經開始與qt從幾天開發。我想要的是移動鼠標光標在特定的位置,我決定一個程序,但是當我編譯即使最簡單的程序,MINGW32打印此錯誤:與mingw32 Qt編譯錯誤
error: undefined reference to `_imp___ZN15QGuiApplicationC1ERiPPci'
error: undefined reference to `_imp___ZN7QCursorC1Ev'
error: undefined reference to `_imp___ZN7QCursor6setPosEii'
error: undefined reference to `_imp___ZN15QGuiApplicationD1Ev'
error: undefined reference to `_imp___ZN15QGuiApplicationD1Ev'
release/main.o: bad reloc address 0x13 in section `.eh_frame'
collect2.exe:-1: error: error: ld returned 1 exit status
這是我的代碼:
#include <QtGui/QGuiApplication>
#include <QtGui/QCursor>
int main(int argc, char *argv[])
{
QGuiApplication a(argc, argv);
QCursor *cur = new QCursor;
cur->setPos(50,50);
return 0;
return a.exec();
}
.pro文件
QT += core
QT -= gui
TARGET = untitled
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
我錯了什麼?我如何解決它?
我對Win8的64位專業的mingw32安裝的Qt 5.1
謝謝
謝謝你,我用嚮導創建項目時出錯。我覺得像這樣一個noob :) –