Jump to content
  • Advertisement
Sign in to follow this  
joanusdmentia

Doxygen & __declspec()

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Yes, you may have to shield that definition with something like the following:


#if (!defined(DOXYGEN))
class __declspec(dllexport) MyClass
#else
class 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? :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!