简体   繁体   English

Visual Studio 2012不产生.exe

[英]Visual Studio 2012 not producing .exe

I just installed and tried to build a simple Hello world program, however I can't seem to find the .exe, nor any way in which I can see the program produce the "hello world". 我只是安装并尝试构建一个简单的Hello world程序,但是我似乎找不到.exe,也找不到能看到该程序产生“ hello world”的任何方式。 Attached are the screenshots of what I am trying to do to build, and the folder in which I believe it should be outputting an .exe 附件是我要构建的屏幕快照,以及我认为应该在其中输出.exe的文件夹。

http://i.imgur.com/HKAmK.png http://i.imgur.com/WK2Hb.png (It isn't in the subfolders either) http://i.imgur.com/HKAmK.png http://i.imgur.com/WK2Hb.png(也不在子文件夹中)

  1. Make sure, that the CPP file is inside the SourceFiles in your project. 确保CPP文件位于项目的SourceFiles内部。 If it is not, it will not be built. 如果不是,则不会构建。

  2. Check the properties of project (especially the General tab) for the output directory for project files. 检查项目的属性(特别是“常规”选项卡)以获取项目文件的输出目录。

  3. Build your project. 建立您的专案。 Visual Studio informs in Output window, where is the binary, eg. Visual Studio在“输出”窗口中通知,二进制文件在哪里,例如。

1>------ Build started: Project: NativeConsoleSketchbook, Configuration: Debug Win32 ------
    1>Build started 2012-12-06 09:39:35.
    1>InitializeBuildStatus:
    1>  Creating "Debug\NativeConsoleSketchbook.unsuccessfulbuild" because "AlwaysCreate" was specified.
    1>ClCompile:
    1>  main.cpp
    1>Link:
    1>  NativeConsoleSketchbook.vcxproj -> D:\Dokumenty\Dev\VS\Sketchbook\Debug\NativeConsoleSketchbook.exe
    1>FinalizeBuildStatus:
    1>  Deleting file "Debug\NativeConsoleSketchbook.unsuccessfulbuild".
    1>  Touching "Debug\NativeConsoleSketchbook.lastbuildstate".
    1>
    1>Build succeeded.
    1>
    1>Time Elapsed 00:00:02.81
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Me too got build succeded message but the exe was not generated. 我也收到了构建成功的消息,但未生成exe。

In Visual Studio Solution Explorer pane, right click on the source file and select properties. 在Visual Studio解决方案资源管理器窗格中,右键单击源文件,然后选择属性。 Make sure it is not set to " Does not participate in build " 确保未将其设置为“ 不参与构建

Change it to the " C/C++ compiler " using the drop down list. 使用下拉列表将其更改为“ C / C ++编译器 ”。

源文件属性页

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

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