all groups > visual studio .net general > april 2005 >
You're in the

visual studio .net general

group:

#ifdef ... error. please help


#ifdef ... error. please help Kevin Ching
4/27/2005 5:11:04 PM
visual studio .net general:
Hi,

I'm using VS .NET 2003 V7.1.3008 with MS .NET Framework 1.1 V1.1.4322 SP1 on
WinXP SP2. I'me getting a strange compiling error and I would appricate if
someone can give me a hand on this.

****code*****

#ifdef _FLAG1
...
#else
....
#ifdef _FLAG2
...
#endif
#endif // this is the error location

****code****

The error message is unexpected #endif statement. The code is at the top of
the file and there is no other code before it. It basically switch between
different #include depending on the flag.

Any help is greatly appricated.

Kevin


Re: #ifdef ... error. please help harry_bosch
4/28/2005 5:49:23 AM
[quoted text, click to view]

Are you using precompiled headers? If so, keep in mind that anything before
the line that includes the PCH header file (e.g. #include "stdafx.h") is
ignored by the compiler, which could lead to baffling error messages. If
your case, if you have an #ifdef before #include "stdafx.h" (for example),
the #ifdef is not seen by the compiler.

--
AddThis Social Bookmark Button