[SOLVED] GUI has a console window



  • Hi I am building a Qt widget app on windows using cmake. However when my gui app starts, I am seeing a 2nd console window opening with it. How can I correct this?

    Here is my cmake file:

    @
    cmake_minimum_required (VERSION 2.6)
    project(UnitTestMonitor)
    include_directories("${PROJECT_SOURCE_DIR}")
    include_directories("${CMAKE_CURRENT_BINARY_DIR}")

    set(QT_ROOT "$ENV{QT_ROOT}")
    set(QT_QMAKE_EXECUTABLE ${QT_ROOT}/bin/qmake)
    set(QT_MOC_EXECUTABLE ${QT_ROOT}/bin/moc)
    set(QT_RCC_EXECUTABLE ${QT_ROOT}/bin/rcc)
    set(QT_UIC_EXECUTABLE ${QT_ROOT}/bin/uic)
    set(QT_INCLUDE_DIR ${QT_ROOT}/include)
    set(QT_LIBRARY_DIR ${QT_ROOT}/lib)
    set(QT_QTCORE_LIBRARY ${QT_ROOT}/lib)

    set(UnitTestMonitor_Source main.cpp udpmonitor.cpp unittestmonitordialog.cpp)
    set(UnitTestMonitor_HEADERS udpmonitor.h unittestmonitordialog.h)
    set(UnitTestMonitor_FORMS unittestmonitordialog.ui)

    set(QT_USE_QTNETWORK TRUE)
    find_package(Qt4 REQUIRED)
    include(${QT_USE_FILE})

    qt4_wrap_cpp(UnitTestMonitor_HEADERS_MOC ${UnitTestMonitor_HEADERS})
    qt4_wrap_ui(UnitTestMonitor_FORMS_HEADERS ${UnitTestMonitor_FORMS})

    add_definitions(${QT_DEFINITONS})

    add_executable(UnitTestMonitor ${UnitTestMonitor_Source}
    ${UnitTestMonitor_HEADERS_MOC}
    ${UnitTestMonitor_FORMS_HEADERS})

    target_link_libraries(UnitTestMonitor ${QT_LIBRARIES})
    @

    [EDIT: code formatting, please wrap in @-tags, Volker]



  • Just had to set the linker settings


Log in to reply
 

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