3

I downloaded Qt SDK and set up paths for qmake etc commands. Now I'm trying to compile "Hello World" program from command-line but don't know how to do that in Windows.

In Linux, it's very simple: qmake -project; qmake; make;

In Windows I tried: qmake -project; qmake; mingw32-make; mingw32-make returns: "Nothing to be done for first"

Source code which I would like to compile is here:

#include <QtGui>
int main(int argc, char *argv[]) {
    QApplication app(argc, argv);
    QMainWindow mainWindow;
    mainWindow.setWindowTitle("Hello World!");
    mainWindow.show();
    return app.exec();
}

I know that I could use Qt Creator IDE but I would like to know how to compile Qt programs in command-line.

Anybody have experiences?

1 Answer 1

4

"Nothing to be done" can indicate that everything was already compiled.
You can run mingw32-make clean and then mingw32-make again to check if that's the case.

Also check that the .pro file generated by qmake -project does list your .cpp file in the SOURCES variable.

Sign up to request clarification or add additional context in comments.

2 Comments

.pro file is almost empty. It has only template variable.
@Karmo Did you run qmake -project in the same directory where the .cpp file is ? Are you using the Qt Command Prompt (that was created in the Start Menu, under QtSDK/Desktop) ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.