c++ - Prevent console window from closing in Visual Studio 2017 cmake project -


visual studio 2017 has built-in support cmake projects, meaning can open folder containing cmakelists.txt , use it. however, there doesn't seem way prevent console window closing after running executable.

with normal visual studio project, can use ctrl+f5 run without debugger attached. however, ctrl+f5 did same thing f5, is, ran executable , closed console window immediately.

another suggestion set subsystem "console" application, cmake project has no visual studio project can set settings for.

i figured maybe go debug , launch settings cmakelists.txt (right click > debug , launch settings > target.exe), opened launch.vs.json. unfortunately, unable find documentation on this. looking through schema, though, seemed if set "nodebug": true, turned off debugger , did nothing stop console closing:

{   "version": "0.2.1",   "defaults": {},   "configurations": [     {       "type": "default",       "project": "cmakelists.txt",       "projecttarget": "target.exe",       "name": "target.exe",       "nodebug": true     }   ] } 

this driving crazy. can't add system("pause") main function, i'm using main function provided test framework. furthermore, should unnecessary; visual studio should handle me.

how can make visual studio console not close after executable finished, when executable cmake project?

i'm using microsoft visual studio community 2017, version 15.2 (26430.16) release


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -