Pretty well every single Qt dialog file has to #include "debug.h"
before any of the Qt system headers or the compiler gets confused.
Why? Because Qt in its wisdom defines a macro DEBUG that clashes with
the DEBUG defined in support/debugstream.h that is #included through
the Qt button controller.

struct debug_trait {
        enum type {
                NONE   = 0,
                EMERG  = 1,
                ALERT  = 2,
                CRIT   = 3,
                ERR    = 4,
                WARN   = 5,
                NOTICE = 6,
                INFO   = 7,
                DEBUG  = 8,
                ANY = 0xffffff
        };

I've tried this fix which seems to work:

ifdef DEBUG
#define CRAPPY_QT_DEBUG DEBUG
#undef DEBUG
#endif

#include "Qt2BC.h"

#ifdef CRAPPY_QT_DEBUG
#define DEBUG CRAPPY_QT_DEBUG
#undef CRAPPY_QT_DEBUG
#endif

Would it be Ok if I added these blocks around struct debug_trait?
Maybe I'll make the macro name more polite ;-)

-- 
Angus

Reply via email to