Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does marking an enum as exported/imported break Doxygen generation?

Tags:

c++

enums

doxygen

Using Doxygen, I stumbled across this warning:

D:/<some/path>/Camera.h:20: warning: documented symbol `enum DLLPORT 
ct::CameraCapture::ct::CameraCapture::CamType' was not declared or defined.

Now I know why Doxygen does not find that class (the namespaces are obviously duplicated), what I don't understand is why it is even searching for it. This enum is in a header file, directly above a class definition, and the class is found fine, it also doesn't get those double namespaces generated. The source code compiles, too, so it probably isn't a syntactic error that is causing Doxygen these problems. Specifically, the source code looks like this:

#ifdef CT_EXPORTS
#define DLLPORT __declspec(dllexport)
#else
#define DLLPORT __declspec(dllimport)
#endif

#include <somelibrary>

namespace ct {
namespace CameraCapture {

/**The type of camera used:
*[...]
**/
enum DLLPORT CamType {
    CT_ENUM1=0,
    CT_ENUM2,
    CT_ENUM3,
    CT_NONE
};

/**\brief A parent-class to cameras of all types.
*[...]
**/
class DLLPORT Camera
{
   //...some content...
};
}
}

This same problem occurs with other enum blocks, too. Hopefully some of you guys know what is happening there.

Cheers

like image 547
QuantumFlux Avatar asked Dec 16 '22 06:12

QuantumFlux


1 Answers

You don't need to dllexport nor dllimport enums. They're mere declarations of a type, not of code. Just use enum CamType. Classes (either en'masse or by-member) will need it, as will individual free functions, but simple enums do NOT.

like image 71
WhozCraig Avatar answered Dec 17 '22 19:12

WhozCraig