error

G

Guest

hi,

i am just about as new to C++ as it gets and i have a friend who gave me a
C++ example. the code is fine because he can compile it but i cant. i have
vc++ express

my first question is: do i click build or compile?

my second question is: i am using iostream but vc++ gives me the error:

"fatal error C1010: unexpected end of file while looking for precompiled
header. Did you forget to add '#include "stdafx.h"' to your source?"

does anyone know what the hell is going on?
 
W

William DePalo [MVP VC++]

Alvo von Cossel I said:
i am just about as new to C++ as it gets and i have a friend who gave me a
C++ example. the code is fine because he can compile it but i cant. i have
vc++ express

my first question is: do i click build or compile?

If you click build, then all of the source files in your project are
compiled and then they are "linked" with any external libraries to generate
an executable.

If you click compile only a single source file is translated to object code.
my second question is: i am using iostream but vc++ gives me the error:

"fatal error C1010: unexpected end of file while looking for precompiled
header. Did you forget to add '#include "stdafx.h"' to your source?"

Some of my pals here might disagree, but at your stage I'd turn off the
option to pre-compile headers (h files).

From the menu, choose Project->xxx Properties->C++->Pre-compiled
headers->Not using pre-compiled headers

Regards,
Will
 
W

William DePalo [MVP VC++]

Alvo von Cossel I said:
thanks a lot.

You are welcome.
it works now

I'm glad.

The option that I helped you turn off speeds up compilation by compiling a
set of headers once and saving the results of that compilation. It can
greatly speed up the process. That's good. But you do have to learn how to
use it. Because you said that you were just starting out, I figured that's
bad. :)

When you have time, you can read about the option here to trade some gain in
complexity for a gain in speed:

http://msdn.microsoft.com/library/d...l/_core_creating_precompiled_header_files.asp

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top