简体   繁体   English

在 VS Code 中编译 c/c++ 时如何禁用自动创建 exe 文件?

[英]how to disable auto-create exe file when compile c / c++ in VS Code?

I have used VS Code我用过 VS 代码

But VS Code create .exe file when compile c or c++ file.但是 VS Code 在编译 c 或 c++ 文件时会创建 .exe 文件。

I never have seen such like this when I used Atom.当我使用 Atom 时,我从未见过这样的事情。

What I want is VS Code does't create .exe file.我想要的是 VS Code 不创建 .exe 文件。

what should I do?我该怎么办?

++attach pic ++附上图片

Before

enter image description here在此处输入图片说明

After

enter image description here在此处输入图片说明

I just compile simple ccc.cpp file which print "eee".我只是编译打印“eee”的简单 ccc.cpp 文件。

After compile, there is a executable.编译后,有一个可执行文件。

You can't get output from a program that doesn't exist. 您无法从不存在的程序获得输出。

Modern compilers don't compile a program and run it directly from memory. 现代的编译器不会编译程序并直接从内存中运行它。 You need to write it to disk first, then you can run it. 您需要先将其写入磁盘,然后才能运行它。

The last compiler I'm aware of that did that was Turbo Pascal. 我知道的最后一个编译器就是Turbo Pascal。

所以我的猜测是您不希望 .exe 文件显示...您要么希望 vscode 在其他转储文件夹中创建 .exe 文件,要么希望在运行程序后将其删除

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM