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. Build a project in command prompt
QtWS25 Last Chance

Build a project in command prompt

Scheduled Pinned Locked Moved Unsolved General and Desktop
command linebulid error
3 Posts 3 Posters 746 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.
  • A Offline
    A Offline
    arash19
    wrote on last edited by
    #1

    Hi forum
    I just starting self study on Qt
    I am trying the first example in book " c++gui programming with qt 4-2nd edition By Jasmin Blanchette; Mark Summerfield"
    #include <QApplication>
    #include <QLabel>
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!");
    label->show();
    return app.exec();
    }

    My Qt is the latest version
    can somebody tel me how to build this simple project in command line?
    I tried and had this error
    " project error: failed to parse default search path from compiler output"

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi and welcome to the forums
      Normally you would have a . pro file also ? ( a project file)

      Why not just use QtCreator ( the Editor ) and make a default project from the New project menu
      and then put your code in its main.cpp.
      That way linking to the Qt libraries and and other stuff is already in order.

      alt text

      1 Reply Last reply
      3
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        To add to @mrjj :

        1) qmake -project "QT += widgets"
        2) qmake
        3) make
        

        The first one will create a project with the required Qt module for widgets.
        The second will create the Makefile.
        The third trigger the compilation.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        3

        • Login

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