Public Group

# Doxygen question (#ifdef problem)

This topic is 4751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi! Any doxygen users here? Probably! Has anybody here had the same problem and maybe solved it? I have a header file with a class that I only include if DEBUG is defined. Doxygen ignored everything inside the #ifdef ... #endif part ... no matter if it is defined or not. If it was defined in the same file it would work. The include guard is not a problem. Ignore that stupid remark ... of course the includeguard has a #ifndef ... I tried putting an #ifdef directly after the #define and the problem occurs as well. [/edit] But DEBUG has to be set in a global header file. Is there a way to fix that problem? Maybe by changing something in the Doxyfile? [Edited by - Clueless on May 24, 2005 7:22:02 AM]

##### Share on other sites
I haven't used doxygen before, but does it hate #if too? You could always give DEBUG a numerical value..
// instead of#define DEBUG... later on..#ifdef DEBUG// you could just do#define DEBUG 0.... later on...#if DEBUG

##### Share on other sites
Thanks for the reply ... good idea. Unfortunately that too doesn't work.
;(

Maybe it is just because I messed with the standard settings.
Probably it usually works.
Such a thing as a bug would be weird. I don't think using ifdefs like that is bad design ... ?

##### Share on other sites
In the doxygen configuration file there is a setting named PREDEFINED. Stick it in there.

Also, the standard method of having debug only code is

#ifndef NDEBUG
//...
#endif

The assert macro uses this method for example.

##### Share on other sites
There's an option in the doxygen settings "Enable preprocessing". Try disabling that, perhaps it's relevant.

##### Share on other sites
Thanks ... adding it to PREDEFINED did the trick.
Guess that is the kind of info I should be able to find in the documentation.
I'm not good at reading those I guess (I tried).
Pretty straightforward ... now that I think of it.

Thanks for the using ifndef as standard tip.
Should have thought of trying that after writing about the include guard (d'oh).

• 10
• 17
• 9
• 14
• 41
• ### Forum Statistics

• Total Topics
631067
• Total Posts
2997735
×