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

时间:2013-09-05 16:15:54

标签: 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.

现在我知道为什么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...
};
}
}

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

干杯

1 个答案:

答案 0 :(得分:11)

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