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

后端 未结 5 1961
后悔当初
后悔当初 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:00

    If you want your program to run in console mode (ie a main function), you have to specify it in your project's properties in MSVC. What you're using right now is a project in windowed mode (ie a WinMain function, which you don't have, hence the error).

    But if you don't want to get the ugly console window, you want to use the windowed mode (ie transform your main function into a propper WinMain function). This way your normal window is all that will show.

    edit: As an aside, you really shouldn't name your program "cmd", that's the name of Windows' command interpreter.

提交回复
热议问题