我从几天开始就开始使用 qt 进行开发。我想制作一个程序,将鼠标光标移动到我决定的某些位置,但是当我编译最简单的程序时,mingw32 会打印此错误:
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();
}
。轮廓
QT += core
QT -= gui
TARGET = untitled
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
我错了什么???我该如何解决?
我在 Win8 Pro x64 上安装了带有 mingw32 的 Qt 5.1
谢谢你