开发者

visual studio 2008 isn't creating an .exe file when i build my project. any ideas why?

i'm new to visual studio and couldn't find anything on google about this. i know this is an extremely noobish question, but i can't seem to find any info for it.

the debug shows me whatever i write, and the build has no errors, so i know the code i'm writing is fine.

the release folder doesn't contain the .exe, even after i build it, rebuild, clean, etc.

it's a win 3开发者_开发知识库2 console project. the release folder contains the .obj files, the manifest, the build log, idb, pch and pdb files (one of each)


Some possible reasons:

  • Did you accidentally create a class library project? In that case the output would be a DLL and not an EXE.
  • Does the output window or the error list display any build errors? In that case you should first fix these, then build again.
  • Did you change the configuration of the project, so that the output (EXE) is created in a different folder than the default one?


There's not a whole lot of reason for people to be guessing... You said you can find the build log - the exact location of any output file will be in there. To make sure you're seeing the right build log file, the output window in VS will have a link to the file that particular build run created:

1>Build log was saved at "file://c:\DevTrees\cppTest\Debug\BuildLog.htm"
1>cppTest - 0 error(s), 2 warning(s)

If you're having trouble interpreting it, post the contents.


I had the same problem; the advice above to look closely at the output window was just what I needed - thanks. My confusion was because I was looking in solution>project>Debug when VS put it in solution>Debug.


The Release and Debug folders contain outputs from different build configurations.

If you look in Project properties, you will see an Output Folder setting in the Build section, and it will be different for each configuration. (You can see the setting for each configuration using the dropdown list at the top of the Project Properties window)

The Release folder will only get populated when you build the project in the Release configuration.

To switch to the Release configuration, use the dropdown list in the toolbar.

EDIT: I am describing the UI for C# projects. It may be different for native code.


Are you sure that your project type is correct? A class library project won't build an executable. It would need to be some sort of application project to create an executable.


I had the same problem. The compilation went fine, but no .exe was generated in the target folder (.\Debug).

The problem was actually that the file containing the main() function was called "FooProject.cpp". I renamed it to "main.cpp" and then the .exe was generated properly.

In other IDEs such as Eclipse CDT, you don't need to have your main file called "main.cpp" as long as you have a proper main() function. This is apparently not the case for Visual C++.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜