Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Simple Makefile without qmake
QtWS25 Last Chance

[Solved] Simple Makefile without qmake

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.6k Views
  • 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 Offline
    S Offline
    Sidii
    wrote on last edited by
    #1

    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
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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
      0
      • S Offline
        S Offline
        Sidii
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

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

          (Z(:^

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved