What's the equivalent of gcc's -mwindows option in cmake?

后端 未结 5 1962
后悔当初
后悔当初 2020-12-11 16:42

I\'m following the tuto:

http://zetcode.com/tutorials/gtktutorial/firstprograms/

It works but each time I double click on the executable,there is a console w

5条回答
  •  星月不相逢
    2020-12-11 17:18

    You can set these linker flags to have a main() entry point and no console:

    SET(CMAKE_EXE_LINKER_FLAGS 
        "${CMAKE_EXE_LINKER_FLAGS} /subsystem:windows /ENTRY:mainCRTStartup")
    

    For more info, see this answer for the linker flags, and this answer for how to set flags in cmake.

提交回复
热议问题