It's my fourth day with <Accelerated C++> and I have to admit that this is WAY over my head.
I picked this book because of the sticky "C++ Books" but really... this was NOT meant for beginners. (or is it just me?)
Okay, enough of the whining.
By taking joeprogrammer's advice, I trashed VC++ 6.0 and got 8.0.
Unlike 6.0, 8.0 inserts stdafx.h to the project. (I learned that I can turn off this option but since it's suppose to save me some time while compiling -- even though I am no where close to creating such big projects that would benefit from a precompiled header -- I decided to not to.)
So there's main.cpp, stdafx.h, stdafx.cpp by defualt.
Since I'm trying to compile a cross reference table code using associative container map in chapter 7, I added files xref.h, xref.cpp, split.h and split.cpp.
When I pressed Ctrl+F5, the build failed and error C1010 showed up.
error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
After including stdafx.h to both xref.cpp and split.cpp it worked.
I've noticed that unlike other header files stdafx.h does not start with #ifndef. Then how is it safe to include the same header to both .cpp files?
Moreover, why does it need to be included in the first place? Isn't it enough to include it once?