[SOLVED] QT 4.8 CMake project



  • Hello,

    I will keep looking for an answer, but here is the CMakeLists.txt and main.cpp of a very basic program that compiles somewhat... but doesn't run. So what's the heck? %QTDIR%\bin in in PATH. What else to check?

    I used this : https://qt-project.org/quarterly/view/using_cmake_to_build_qt_projects

    Compilation message :

    @[100%] Building CXX object CMakeFiles/FirstApp.dir/main.cpp.obj
    main.cpp
    Linking CXX executable FirstApp.exe
    LINK : FirstApp.exe not found or not built by the last incremental link; performing full link

    [100%] Built target FirstApp
    14:05:32: The process "C:\Qt\Qt5.2.0\Tools\QtCreator\bin\jom.exe" exited normally.
    @

    CMakeLists.txt:

    @cmake_minimum_required(VERSION 2.8.8)

    project(FirstApp)

    FIND_PACKAGE(Qt4 REQUIRED)

    SET(FirstApp_SOURCES main.cpp)

    INCLUDE(${QT_USE_FILE})
    ADD_DEFINITIONS(${QT_DEFINITIONS})

    executable then list of files

    add_executable(
    FirstApp
    ${FirstApp_SOURCES}
    )

    target_link_libraries(
    FirstApp
    ${QT_LIBRARIES}
    )
    @

    main.cpp hello world code:

    @#include <iostream>
    #include <QCoreApplication>
    #include <QDebug>
    #include <qmath.h>

    using namespace std;

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    cout << "Hello World";
    
    return a.exec(&#41;;
    

    }@

    Thanks,

    Barbara



  • It seems that compilation goes well because I removed FirstApp* files from build directory and the message mentioned above went awway.

    When launching it stays stuck at "Starting C:\Developpement\Projects\FirstApp-build\FirstApp.exe...". Any clue where to have a look ?



  • I made it working by checking "run in terminal" in run settings!


Log in to reply