Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [Solved] Simple Makefile without qmake

    General and Desktop
    2
    4
    1322
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sidii last edited by

      Dear All,

      I generally use qmake for qt projects. But now i want to integrate QT with my old project. So i want to learn how to create the Makefile without using qmake.

      Lets suppose i have few lines of code:

      #include <QApplication>
      #include <QLabel>

      int main (int argc, char *argv[])
      {
      QApplication app(argc, argv);
      QLabel *label = new QLabel("Hello World");
      label->show();
      return app.exec();
      }

      For the above lines Q_Object Macro is not needed so there is no need of doing moc.
      So my simple question is how should i write the makefile to compile the above lines?

      We need to include LIBS like -lQt5Core -lQt5Gui, lQt5Widgets. Apart from this we also need to include one include folder.

      Kindly let me know what else we need.

      Looking forward for the quick help.

      Thanks a lot.

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        If you want a quick solution: generate the Makefile with qmake (once) and then strip it off the things you don't need (there will be a lot of code there).

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • S
          Sidii last edited by

          Dear Sierdzio, thanks a lot for the pointer. It worked!!

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            Hey, I'm glad to hear that. Happy coding!

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • First post
              Last post