Compiling C in Visual Studio 2010 Not Creating .EXE File

不羁的心 提交于 2019-12-13 04:03:32

问题


I'm able to debug a C program in Visual Studio 2008 and build it. However, the build process doesn't seem to leave an .exe in the folder it builds in. Regardless of if I choose Release or Debug. Could the .exe be sent somewhere else? How can I tell?

Contents of the Debug folder under the main folder of the project:
cl.command.1.tlog
CL.read.1.tlog
CL.write.1.tlog
ConsoleApp.Build.CppClean.log
ConsoleApp.exe.embed.manifest
ConsoleApp.exe.embed.manifest.res
ConsoleApp.exe.intermediate.manifest
ConsoleApp.lastbuildstate
ConsoleApp.log
ConsoleApp.obj
ConsoleApp_manifest.rc
link-cvtres.read.1.tlog
link-cvtres.write.1.tlog
link.1504-cvtres.read.1.tlog
link.1504-cvtres.write.1.tlog
link.1504.read.1.tlog
link.1504.write.1.tlog
link.command.1.tlog
link.read.1.tlog
link.write.1.tlog
mt.command.1.tlog
mt.read.1.tlog
mt.write.1.tlog
rc.command.1.tlog
rc.read.1.tlog
rc.write.1.tlog
stdafx.obj
vc100.idb
vc100.pdb


回答1:


Right click the project node and open the property page:-

In General node in Configuration Properties.
There you'll see two fields:-

  1. Output Directory
  2. Target Extension. if the target extension is .exe then the things are fine.
    Look in the Output DIrectory, you'll find the executable.

EDIT:- You are looking at wrong place. You have to see here (an example):-

C:\Documents and Settings\USER\My Documents\Visual Studio 2010\Projects\C\The_c\Debug

And you are seeing here

C:\Documents and Settings\USER\My Documents\Visual Studio 2010\Projects\C\The_c\The_c\Debug

That is two directory above the present directory.




回答2:


Have you tried checking the Output Path in the project properties?




回答3:


I encountered this error when (for some reason) multiple MSBuild.exe's were to be found in the taskmanager. I killed them all, and it worked again.




回答4:


I found that it was because of the counter intuitive way that visual studio builds the directory structure when you make a new console app. You get two folders and two debug folders viz

├───MakeSubscriber
│   ├───Debug
│   ├───ipch
│   │   └───makesubscriber-67e243a
│   └───MakeSubscriber
│       └───Debug

so all the tlog and intermediate files go in one Debug folder and the exe, ilk and pdb go in the other




回答5:


I have spent about 3 hours trying figure this out, finally got it: You'll notice that in the project file, there is a debug folder. In this folder should NORMALLY be an

an .exe file, 
a .ilk file, 
and a .pdb file. 

These were missing for me. How I fixed it:

I copied those 3 files from another project's debug folder and pasted them into my project's Debug folder. Then I renamed them to match my C++ file(.cpp)'s name. This isn't enough however, you have to save it like that and then close Visual Studio, then open the project file again from Windows explorer.

That did it for me!! Fiiinalllly!!!




回答6:


I was able to resolve this issue for my whole class. The problem was when doing a win32 console application empty and then creating .cpp, the program was not adding the .cpp to the end of the .cpp file name. When I added it manually, such as practice.cpp instead of just practice, it created the .exe file. It worked for everyone having the issue.



来源:https://stackoverflow.com/questions/11951694/compiling-c-in-visual-studio-2010-not-creating-exe-file

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