Question:
How do u compile in VC++ 2008?
Cher
2009-05-27 10:03:03 UTC
How do i compile a file in VC++ 2009? I just installed, am a new user of VC++.

Also, can you please gimme an example code of a prog i can run for starters...right now am referring this book by Yeshawant Kanetkar, but it doesnt say anything about compiling and installing.

I tried "Build Solution"...all it does is reports an error: unable to open file.

SO basically wat i wanna knw is how to compile, and a small piece of code i can try out as my first!

Thanks!
Three answers:
rovr138
2009-05-27 10:51:36 UTC
If you read the error, it's telling you that the header file "stdafx.h" doesn't exist or that it can't be found... IDK why...





A simple program that can be compiled would be something like



#include



int main()

{

std::cout << "Hello World! \n";

return 0;}



(idk why you're using stdafx.h)



Now look for the debug option (or look for the green play button).
2009-05-27 11:43:23 UTC
When you create a project through VS it automatically inserts an stdafx.h/cpp file into your project. This is an optimization step to speed up the build.



For example, your #include statement should have gone there.



Basically what I read is you have deleted the stdafx.h file from the folder. To get past this try commenting out the line that includes stdafx.h.
Mecal
2009-05-27 11:01:44 UTC
Take a look at the "Introduction to Visual C++ 2008 Express Edition" video at:

http://msdn.microsoft.com/en-us/beginner/bb964629.aspx

||


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...