How do I keep my Qt C++ program from opening a console in Windows?

后端 未结 5 2004
有刺的猬
有刺的猬 2021-02-19 10:10

I\'m making an application in Qt Creator, with cmake and MinGW as compiler. I\'ve seen this question being answered for other people, but they used regular Qt projects with .pro

5条回答
  •  心在旅途
    2021-02-19 11:11

    For building with Mingw, add a CMake command:

    set_target_properties(target_name PROPERTIES LINK_FLAGS "-mwindows")
    

    Replace target_name with your target's name (first parameter to add_executable)

提交回复
热议问题