views:

42

answers:

1

So I am trying to build an 32 bit application in 64. I am linking to all 64 bit libraries, and I have recompiled everything we used for 64 bit.

I am getting weird errors now. I have seen some similar errors over the net but nothing useful in those topics.

Any idea what could be wrong that causes this behavior?

warning C4091: 'typedef ' : ignored on left of 'float' when no variable is declared C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\windef.h error C2632: 'float' followed by 'double' is illegal
C:\Program Files\MicrosoftSDKs\Windows\v6.0A\include\windef.h

warning C4091: 'typedef ' : ignored on left of 'double' when no variable is declared C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wtypes.h Error 44 error C2632: 'double' followed by 'double' is illegal
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wtypes.h

Warning and error are for the same line. Clearly its not a problem with wtypes.h and windef.h (and if it was i cant do anything about it)

typedef float               FLOAT;

typedef double DOUBLE;

Clearly these are fine by itself so it has to be something else. File in my project that causes this just includes

Any ideas?

+2  A: 

It looks like FLOAT and DOUBLE have been previously #defined to double. This might be a result of another library, although it seems unlikely to be caused by switching to 64-bit compilation. Try doing

#undef FLOAT
#undef DOUBLE

Prior to including windows.h or windef.h or whichever file is directly responsible for the warning.

Mark B
it seems that this fixes the issue, but how would i find out what stepped over the definitions?
grobartn
If you put something like `#define DOUBLE TESTER` as the very first line in your source file, the compiler should yell at you at the point (most likely include line) where it's redefined to `double`.
Mark B
You could also use trial and error (comment out #includes) or have a look at the preprocessor output (cl /E). Mark B's suggestion is probably your best bet though.
Nick