Visual-studio – Why Isn’t My C Code Being Compiled To An EXE

c++visual-studio

I'm just starting out writing trying to write a simple program in C and I am using Visual Studios to do so. I heard that it does compile C as well as C++. And I know that it does because it says it compiles. The only problem is that when I go to the output directory, there isn't a .exe file in the directory! It has the following:

  • BuildLog.html
  • mt.dep
  • test1.obj
  • vc90.idb
  • vc90.pdb

But that is all! No EXE. I've looked through all the options and made sure that it is set to compile to an exe and i checked the output file. That is $(OutDir)\$(ProjectName).exe. But alas, no exe appears. Any ideas?

Also when i try to hit f5 and run with debut i get an error that says

This application has failed to start
because MSVCR90.DLL was not found.
Re-installing the application may fix
this problem

Best Solution

By default when you're creating a new C++ project within a new solution, you're getting folder structure like this:

C:\Projects\YourSolution C:\Projects\YourSolution\YourCppProject

YourSolution contains YourSolution.sln and YourCppProject contains YourCppProject.vcproj.

When you build the solution, all intermediate files from YourCppProject are getting stored under YourCppProject\Debug or YourCppProject\Release, but resulting YourCppProject.exe goes under YourSolution\Debug or YourSolution\Release.

Your $(OutDir) is configured by General -> Output Directory. Check project configuration for YourCppProject and see that it uses $(SolutionDir) for the output.