I dont want console to appear when i run c++ program

后端 未结 7 796
时光取名叫无心
时光取名叫无心 2021-02-07 11:24

I want to write one c++ program, compiling and linking .cpp gives .exe file. if i double click on that and execute it a console gets opened and closed. I don\'t want that consol

7条回答
  •  天涯浪人
    2021-02-07 11:45

    make sure you define _WINDOWS or WINDOW during compile and linking. (depending on your environment).

    On the commandline you can do this as follows

    cl -D_WINDOWS  program.cpp
    

提交回复
热议问题