Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] GUI has a console window

[SOLVED] GUI has a console window

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 1 Posters 2.3k 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.
  • R Offline
    R Offline
    ryadav
    wrote on last edited by
    #1

    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]

    Kind Regards,
    Rajinder Yadav

    SafetyNet Test Driven Development
    http://safetynet.devmentor.org

    1 Reply Last reply
    0
    • R Offline
      R Offline
      ryadav
      wrote on last edited by
      #2

      Just had to set the linker settings

      Kind Regards,
      Rajinder Yadav

      SafetyNet Test Driven Development
      http://safetynet.devmentor.org

      1 Reply Last reply
      0

      • Login

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