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 :) –