Visual Studio doesn't open a DOS window when I run my Assembly language program with control-F5

只谈情不闲聊 提交于 2019-12-13 08:41:05

问题


I have setup everything. When I click Ctrl+F5, it does not show anything. I just want it to show my name with a black window. How do I do that?


回答1:


Most likely you have the subsystem set to "Windows application", which means the process will start with no console associated. Attempts to write will then fail.

You can either associate a console with AttachConsole() and/or AllocConsole() or change the subsystem via linker command line (/SUBSYSTEM:CONSOLE).




回答2:


Instead of running your program from within the development environment, open a Command Prompt window and navigate to the folder where the .exe is created and run it directly. That's how command-line programs are meant to be run.

If you have to run it in the development environment, perhaps for debugging, then put a breakpoint on the return or exit statement so it stops before the window is closed.



来源:https://stackoverflow.com/questions/48634923/visual-studio-doesnt-open-a-dos-window-when-i-run-my-assembly-language-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!