Compile a Qt project from command Line

前端 未结 3 1637
情话喂你
情话喂你 2020-12-13 03:54

I am developing a application using Qt, the C++ library/framework. Using the QT-Creator I can compile my project just fine and the build directory generates the desired exec

相关标签:
3条回答
  • 2020-12-13 04:36

    Thanks for the tips guys. I realized what I was doing wrong. QT-Creator actually takes the first two steps silently.

    1. Create the build output directory
    2. CD to the build output directory (KEY STEP)
    3. Call qmake referencing the .pro file
    4. Call make

    So, the key thing that I overlooked was that you had to be in the build directory first and then call qmake, make etc... And also if the build already has the files compiled it throws that error. I just have to make sure I clean the build directory to compile everything fresh.

    0 讨论(0)
  • 2020-12-13 04:45

    In terminal window

    1. cd ~/your_project_folder/
    2. qmake -project
    3. qmake
    4. make
    0 讨论(0)
  • 2020-12-13 04:47

    If compiling an existing project, qmake -project is actually wrong, see "qmake --help".

    qmake -makefile
    make
    

    If its a large project, "make -j4" or similar.

    0 讨论(0)
提交回复
热议问题