Error: undefined reference to `qMain(int, char**)'



  • When I compiled my project,Qt Creator showed this error.I googled it,and many people say it's because of losing main function.But I actually have main function.
    main.cpp
    @#include<QApplication>
    #include"dialog.h"

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    dialog d;
    d.show();

    return app.exec();
    }
    @

    .pro
    @TEMPLATE = app
    TARGET = custombutton_mine
    HEADERS +=
    mybutton.h
    dialog.h

    SOURCES +=
    mybutton.cpp
    dialog.cpp
    main.cpp

    FORMS +=
    dialog.ui@


Log in to reply
 

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