C1020

M

Mike Deep

Hello,

<snip>

#if (WIN32)
#include "stdafx.h"
#endif

int _tmain(int argc, _TCHAR **argv) {
#if (WIN32)
printf("errrr\n");
#endif
return 0;
}

</snip>

I get a C1020 :-( on the first #if instruction.
Why ?
I should be able to use #if out of a function!!
When i remove the the first #if, the program compiles.

Is it a bug from my brain or ms ? :p

Mike
 
M

Mike Deep

I would like to inform you that the Managed C++ flag must be enabled to get
the error on VC7.
#if (WIN32)
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
#else
#include <stdio.h>
#include <stdlib.h>
#endif
#if (WIN32)
int _tmain(
int argc,
_TCHAR *argv[]
) {
#else
signed int main(
signed int argc,
signed char **argv
) {
#endif

because the pre-processor doesn't detect my first #ifdef the second pre-proc
instruction is dead.

/Od /AI "XXXXXXX" /D "WIN32" /D "_DEBUG" /D "_MBCS" /FD /EHsc /MTd /GS
/Yu"stdafx.h" /Fp"Debug/XX.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo
/c /Zi /clr /TP /FU

It really look a microsoft bug, if not that sux for software port.
 

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

Members online

No members online now.

Forum statistics

Threads
474,417
Messages
2,571,578
Members
48,797
Latest member
shadowoftheunknown

Latest Threads

Top