Problem with Qmake generated Makefile



  • Hello! New to QT here. I just got everything installed yesterday, made a short test file, and ran qmake -project. When I tried using the "make" command, however, my terminal produced this error:

    Makefile:66: *** multiple target patterns. Stop.

    I'm currently running windows 8 and installed QT version 4.8. Thanks in advance for the help!


  • Moderators

    Hi, and welcome to the Qt Dev Net!

    If you are new to Qt, I highly recommend starting with Qt 5.2.1. Qt 4.8 is very old, and is no longer actively developed. The Qt 5.2.1 packages include the Qt Creator IDE, so you don't need to call qmake manually.

    But anyway, what files did you ask qmake to process? If you use the "-project" flag, qmake produces a .pro file, not a Makefile.



  • Hello, and thank you for your reply!

    I will try 5.2.1 on a different machine, but I would like to try getting 4.8 working on this one. I used the qmake -project to create the .pro file and called qmake after the .pro was generated. Here is the code that I was trying to compile:

    #include <QApplication>
    #include <QPushButton>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QPushButton button("Hello world!");

    button.show();
    return app.exec();
    }


  • Moderators

    Can you post the contents of your .pro file?

    You might also consider installing the standalone Qt Creator 3.0 to handle qmake for you. If it doesn't auto-detect your tools...

    See "Adding Compilers":http://qt-project.org/doc/qtcreator-3.0/creator-tool-chains.html to tell Qt Creator where to find your compiler

    See "Adding Qt Versions":http://qt-project.org/doc/qtcreator-3.0/creator-project-qmake.html to tell Qt Creator where to find the Qt binaries

    Finally, see "Adding Kits":http://qt-project.org/doc/qtcreator-3.0/creator-targets.html to tell Qt Creator how to combine your toolchain with the Qt binaries.



  • ######################################################################

    Automatically generated by qmake (2.01a) Sat Mar 8 05:52:33 2014

    ######################################################################

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

    Input

    SOURCES += qt_test.cpp


  • Moderators

    The .pro file might be incomplete. According to https://qt-project.org/forums/viewthread/7487 you are expected to hand-modify the output of qmake -project. Try this:

    Add this line to the end of the .pro file: "QT += core gui"

    Add a name to "TARGET" (this will be your executable file name)

    Again, I recommend setting up new projects through Qt Creator.



  • Just got it working! Apparently I was using a cygwin version of make, as opposed to mingw32-make. Thanks so much for your help!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.