Click to See Complete Forum and Search --> : new to visual c++. Question....


Evan8
07-11-2001, 10:22 AM
Hi all,

i'm new to VC++ (and c++ in general, to be honest). I wanted to create a console application, and c++ always includes the file "stdafx.h", which it creates. For example, this happens when creating a new "Hello world" Win32 console app. Why is it that when i need this "stdafx.h" file? Other compilers are fine with:

int main()
{
return 0;
}

but vc++ gives errors when i compile this. why? is there any way to simply print to the console without stdafx and all?

thanks! sorry for any confusion http://www.sharkyforums.com/ubb/smile.gif
-evan

reklis
07-11-2001, 11:30 AM
What errors are you getting? All you have to do to stop it from *****ing at you is give it whatever code bloat it wants.

------------------
Advocate of the Sharky (Ultra) High-Resolution Club [SHRC (http://www.sharkyforums.com/ubb/Forum17/HTML/005121.html)]
main(i){putchar(341513875>>(i-1)*5&31|!!(i<6)<<6)&&main(++i);}

reklis
07-11-2001, 11:33 AM
Oh, and what version are you using? Whatever it is, make sure it's fully patched to the latest version. In 6.0 the compiler actually *regressed* from 5.0 in native C++ support. I still run 5.0+sp3, and I'm very happy with it.

------------------
Advocate of the Sharky (Ultra) High-Resolution Club [SHRC (http://www.sharkyforums.com/ubb/Forum17/HTML/005121.html)]
main(i){putchar(341513875>>(i-1)*5&31|!!(i<6)<<6)&&main(++i);}

Evan8
07-11-2001, 12:19 PM
thanks for offering to help (always good to know ppl are out there!) but i figured it out!

In the project settings, under the c++ tab, there is a directive to include the "stdafx" header file (the command looks something like '\Yu "stdafx.h"'. I just took that out and now it works. Before this, it would tell me that it couldn't find some precompiled header file (the stdafx file)

thanks
-ev