Doxygen & __declspec()

Started by
1 comment, last by joanusdmentia 19 years, 4 months ago
It would appear that doxygen doesn't like it the following:

// MyClass.h

/// A class.
class __declspec(dllexport) MyClass
{
public:
    /// A brief description.
    void Func();
};


// MyClass.cpp
#include "MyClass.h"


/**
 * A full description.
 */
void MyClass::Func()
{
}

It spits out the warning
Warning: documented function `void MyClass::Func' was not defined.
If I comment out the __declspec() doxygen will recognize it properly, but this obviously won't do since I'm compiling to a dynamic library. Has anyone encountered this problem before or am I doing something stupid?
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Advertisement
Yes, you may have to shield that definition with something like the following:

#if (!defined(DOXYGEN))class __declspec(dllexport) MyClass#elseclass MyClass#endif{public:    /// A brief description.    void Func();};


Then, you should be able to add the define DOXYGEN to your 'preprocessor' settings under the Doxywizard front-end. I know it's ugly, but it's probably pretty neccessary.

Another thing I haven't tried yet but involves the same kind of trickery. Try keep your source as you have it, then in the Doxywizard 'preprocessor' settings add something like
#define __declspec(x)
This should preprocess all __declspec(dllexports) out of the code before doxygen parses it.

Anything help there? :)
do unto others... and then run like hell.
Yep, thanks!

Setting "__declspec(dllexport)=" in the predefines works. You have to be sure to remember the '=' though, not including it will define it as "1" by default.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V

This topic is closed to new replies.

Advertisement