为什么将enum标记为导出/导入中断Doxygen生成?

Qua*_*lux 4 c++ enums doxygen

使用Doxygen,我偶然发现了这个警告:

D:/<some/path>/Camera.h:20: warning: documented symbol `enum DLLPORT 
ct::CameraCapture::ct::CameraCapture::CamType' was not declared or defined.
Run Code Online (Sandbox Code Playgroud)

现在我知道为什么Doxygen没有找到那个类(命名空间显然是重复的),我不明白为什么它甚至在搜索它.这个枚举是在一个头文件中,直接在一个类定义之上,并且找到了很好的类,它也没有生成那些双重命名空间.源代码也编译,所以它可能不是导致Doxygen这些问题的语法错误.具体来说,源代码如下所示:

#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...
};
}
}
Run Code Online (Sandbox Code Playgroud)

其他enum块也会出现同样的问题.希望你们中的一些人知道那里发生了什么.

干杯

Who*_*aig 11

你不需要dllexport或dllimport枚举.它们仅仅是一种类型的声明,而不是代码的声明.只是用enum CamType.类(en'masse或by-member)将需要它,个别自由函数也是如此,但简单的枚举不需要它.

  • C++ 11枚举类怎么样?它们应该被标记为dllexport/dllimport吗? (10认同)