So far all the options mentioned above still return the following build error: main.cpp|3|fatal error: stdafx.h: No such file or directory|
The compiler tells you it cannot find the header file. If you look at the
full build log you'll see in what folder the compiler looks for this file. If its in none of these, add an include statement accordingly. If you don't know how to setup the include folder in C::B, there is a nice section in the C::B manual, including images.
stdafx.h belongs to the MFC classes, so you need an MFC capable compiler (MSVC) plus the Windows/MFC SDK or simply replace the code that is MFC dependent.
However, this forum is
not for discussing such topics as it is
not a C::B issue. Please post such questions either in a C/C++ forum or in a MSVC / MFC forum.