Running other C++ applications on QT?



  • How to run other C++ applications and get it to build on QT creator?


  • Moderators

    @AAlex7 What do you mean? You mean like a non-Qt application?

    I would just use cmake and a CMakeLists.txt, which Qt Creator can load. You could use qmake too, but then you have at least a bit of qmake involved.

    I.e.

    main.cpp

    #include <iostream>
    
    using namespace std;
    
    int main(int ac, char **av)
    {
       cout << "hello world" << endl;
       return 0;
    }
    

    CMakeLists.txt

    cmake_minimum_required(VERSION 3.8)
    project(myproject)
    
    add_executable(${PROJECT_NAME} main.cpp)
    

    Then open that CMakeLists.txt file in qt creator and press build.

    Also CMake fully supports Qt so you can add Qt to your project later if you'd like.


  • Qt Champions 2017

    @AAlex7 Just run File -> New File or Project to see the list of possible projects with the different supported build systems.


Log in to reply
 

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