How not to write a compiler 2006 April 24 15:26
Posted by diamond in : Work , trackbackA case study:
The top of my code:
#define WIN_VERSION //needed for ext.h
#include "ext.h"
Code i inserted into the top of ext.h, a header file from an sdk i’m using, to try and debug stuff:
#ifndef WIN_VERSION
#error WIN_VERSION is not defined. why?
#endif
So, guess what happens when i try compile the project?
...\ext.h(2) : fatal error C1189: #error : WIN_VERSION is not defined. why?
If i put the #define in ext.h, it works. If i tell the compiler to define WIN_VERSION at compile time, it works. So why oh why is Visual C++ 6 unsetting WIN_VERSION between my code and the sdk? Why? Gah.

Comments»
Wow. Sounds like you’re having/had a fun day (: