如何在 Visual Studio C++ 中构建 exe

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4335341/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 15:09:12  来源:igfitidea点击:

How to build exe in Visual Studio C++

c++visual-studio

提问by newandfresh

I am a .NET C# developer and trying to learn C++.

我是一名 .NET C# 开发人员,正在尝试学习 C++。

I am having issues in trying to create an exe from a console app from Microsoft Visual Studio when I do a build compile and check the Debug folder. There isn't any exe, just some manifest files and other files. I am asking this because I am not sure if this is how it works? is there any another way of doing this?

当我进行构建编译并检查 Debug 文件夹时,我在尝试从 Microsoft Visual Studio 的控制台应用程序创建 exe 时遇到问题。没有任何 exe,只有一些清单文件和其他文件。我问这个是因为我不确定这是否是它的工作原理?有没有其他方法可以做到这一点?

I have tried the Microsoft Visual Studio console and c:\cl test.cpp, this gives me an test.exe but can it be done from the MSVS GUI like in C#?

我已经尝试过 Microsoft Visual Studio 控制台和 c:\cl test.cpp,这给了我一个 test.exe,但是它可以像在 C# 中一样从 MSVS GUI 完成吗?

回答by Nick

Have you checked the debug folder at the solution level? I believe this is the default target directory. The DEBUG folder in the project is for the output of temporary build files.

您是否检查了解决方案级别的调试文件夹?我相信这是默认的目标目录。项目中的 DEBUG 文件夹用于临时构建文件的输出。

回答by Madhur Ahuja

Did it compile successfully ? Also, check your active configuration if its debug or Release ?

编译成功了吗?此外,检查您的活动配置是调试还是发布?

Also, check the output path to double check the location of executable.

此外,检查输出路径以仔细检查可执行文件的位置。

It works the same as C#, so there is no need for command line.

它的工作原理与 C# 相同,因此不需要命令行。