0

When I try running a Qt application with the following main.cpp file:

#include <QApplication>
#include "ui_checkabder.h"
#include <QDialog>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Ui::CheckAbder ui;
QDialog *dialog = new QDialog;
ui.setupUi(dialog);
dialog-&gt;show();
return app.exec();
}

I get the following errors:

c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib/libqtmaind.a(qtmain_win.o):-1: In function `WinMain@16':

c:/ndk_buildrepos/qt-desktop/src/winmain/qtmain_win.cpp:131: error: undefined reference to qMain(int, char **)

:-1: error: collect2: ld returned 1 exit status

And, abder.pro looks like this:

######################################################################
# Automatically generated by qmake (2.01a) Mon Apr 18 09:52:56 2011
######################################################################

TEMPLATE = app
TARGET = 
DEPENDPATH += .
INCLUDEPATH += .

# Input
FORMS += checkabder.ui

How can I solve those errors? Provided that I'm using Qt Creator.

Thanks.

Edited by SWEngineer: n/a

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by SWEngineer
0

You should try adding the following line to the .pro file:

QT       += core gui

Also, you should provide a name in the TARGET field:

TARGET = myexecutable.exe
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.