PDA

View Full Version : Nothing to be done for `first'.



IdontExist
25th April 2013, 19:58
I'm trying to compile my first QT programme but i came across a pretty popular problem, which I can't solve even after browsing this forum.
This is the code I am using:

#include <QCoreApplication>
#include <QDebug>

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

QCoreApplication a(argc, argv);
qDebug() << "hello";
return a.exec();
}


After trying to build it i get this 'error':

C:/MinGW/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/Max/Desktop/tutajjestQT/hello-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
mingw32-make[1]: Nothing to be done for `first'.
mingw32-make[1]: Leaving directory `C:/Users/Max/Desktop/tutajjestQT/hello-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'

And w window with "Naci" written in it in which, later on, i can later whatever i want:
8989

Can anyone help me with what's wrong, please?

ChrisW67
25th April 2013, 23:14
There is no error, or even warning, there. The message is from your make utility (http://en.wikipedia.org/wiki/Make_%28software%29) telling you it determined that the compiled program did not need to be recompiled because it was newer than the source files that go into it.

The window comes from running the program in Qt Creator (I am assuming you are using that) which, by default for non-GUI applications, will run the program in a terminal. It normally contains your program's console output and ends with a message like "Press Enter to close" once the program terminates. However, your program does not run to completion because you enter the event loop (line 9) and will need to use Ctrl-C or similar to terminate it.

Try replacing line 9 with:


return 0;

IdontExist
26th April 2013, 00:48
Yes, I am using Qt Creator and i tried to make an console application.
I replaced line 9 with the code You gave me but nothing changed.

ChrisW67
26th April 2013, 01:06
Post your PRO file and do a clean rebuild of the program.

IdontExist
26th April 2013, 10:34
This is my hello.pro file:

#-------------------------------------------------
#
# Project created by QtCreator 2013-04-25T20:30:08
#
#-------------------------------------------------

QT += core

QT -= gui

TARGET = hello
CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app


SOURCES += main.cpp

I also did a full rebuild of my programme.