Vaughan Daniel
July 16th, 1999, 11:33 AM
Can someone please explain to me why you can't have #include statements within a #ifdef #else # endif conditional structure in Microsoft C++ ver. 6.0?
example:
#ifdef LEGACY_CODE
#include "first.h"
#include "second.h"
#else
#include "third.h"
#include "fourth.h"
#endif
The compiler gives the error 'fatal error C1020: unexpected #else'.
This is the first time I attempted to do this so I am not sure if this is just MS compilers or all C++ compilers in general.
example:
#ifdef LEGACY_CODE
#include "first.h"
#include "second.h"
#else
#include "third.h"
#include "fourth.h"
#endif
The compiler gives the error 'fatal error C1020: unexpected #else'.
This is the first time I attempted to do this so I am not sure if this is just MS compilers or all C++ compilers in general.