qtcmakeqt-creator

Qt Creator doesn't opens the project


I'm trying to open my project in qt creator, by instruction here, but it opens only a CMakeLists.txt file. When i trying to open folder with project like code space, it says You need to set an executable in the custom run configuration and i didn't find run configuration


Solution

  • I think you're just opening the CMakeLists.txt file directly, but usually open a file won't encounter the error message like that, maybe you can follow these steps first:

    1. Go to File -> Open File or Project....
    2. Navigate to the folder containing your project's CMakeLists.txt file.
    3. Select the CMakeLists.txt file and click Open.

    Qt Creator should now recognize this as a CMake project and prompt you to configure the project, and after selecting the CMakeLists.txt file, Qt Creator will ask you to set up a kit (which includes the compiler and Qt version). Just choose the appropriate kit for your project (e.g., MSVC, MinGW) and click on Configure Project, and see if everything's all right.

    By the way, if you get the message You need to set an executable in the custom run configuration, it means Qt Creator does not know which target to run. I think you should check the Run settings, ensure that the correct executable is selected. If it's not set, you may need to define it.

    If everything is configured correctly, rebuild the Project. Once built, you should be able to run your application.