Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] QT 4.8 CMake project
Forum Update on Monday, May 27th 2025

[SOLVED] QT 4.8 CMake project

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 1 Posters 1.9k 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.
  • P Offline
    P Offline
    postb99
    wrote on 3 Mar 2014, 13:09 last edited by
    #1

    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

    1 Reply Last reply
    0
    • P Offline
      P Offline
      postb99
      wrote on 3 Mar 2014, 13:30 last edited by
      #2

      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 ?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        postb99
        wrote on 3 Mar 2014, 14:04 last edited by
        #3

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

        1 Reply Last reply
        0

        1/3

        3 Mar 2014, 13:09

        • Login

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