使用代码块13.12时,Doxygen未生成正确的继承结构 我试图在C++中获得这个简单的类结构,以生成正确的doxGEN HTML文件。我正在使用codeblocks 13.12的提取文档生成doxyfile。然后我在代码块中使用doxywizard功能调用macport的doxygen版本1.8.7。每次我生成doxygen html输出时,类rider中的新_实例方法都会丢失。有办法解决这个问题吗?我做错什么了吗 class cowboy /** a class to store and utilize horses */ { public: virtual ~cowboy() {} int horse; /**< an integer that counts the number of horses the cowboy owns */ /** @brief prints the number of horses * */ void print() { std::cout<< "I ride a horse and own " << horse << " horses.\n"; } /** \brief creates a new instance of cowboy * * \return cowboy* the location the new instance of cowboy is stored * */ virtual cowboy* new_instance() //operates with factory { return new cowboy; } }; class rider: public cowboy /**an object that also owns horses but is not as cool as a cowboy */ { /** @brief creates a new instance of rider as a cowboy pointer * * @return cowboy* the location the new instance of rider is stored * */ cowboy* new_instance() { return new rider; } };

使用代码块13.12时,Doxygen未生成正确的继承结构 我试图在C++中获得这个简单的类结构,以生成正确的doxGEN HTML文件。我正在使用codeblocks 13.12的提取文档生成doxyfile。然后我在代码块中使用doxywizard功能调用macport的doxygen版本1.8.7。每次我生成doxygen html输出时,类rider中的新_实例方法都会丢失。有办法解决这个问题吗?我做错什么了吗 class cowboy /** a class to store and utilize horses */ { public: virtual ~cowboy() {} int horse; /**< an integer that counts the number of horses the cowboy owns */ /** @brief prints the number of horses * */ void print() { std::cout<< "I ride a horse and own " << horse << " horses.\n"; } /** \brief creates a new instance of cowboy * * \return cowboy* the location the new instance of cowboy is stored * */ virtual cowboy* new_instance() //operates with factory { return new cowboy; } }; class rider: public cowboy /**an object that also owns horses but is not as cool as a cowboy */ { /** @brief creates a new instance of rider as a cowboy pointer * * @return cowboy* the location the new instance of rider is stored * */ cowboy* new_instance() { return new rider; } };,c++,doxygen,C++,Doxygen,其他可能有用的信息。我拥有的codeblocks版本是32位应用程序,您可以直接从codeblocks的网站下载。操作系统是Mountain Lion,以防此问题特定于该版本的操作系统 原来问题是由于将继承结构放在同一个文件中引起的。我不确定它是.h文件还是.cpp文件是否重要。在我的例子中,我使用的是一个.cpp文件。问题是,doxygen在将新的_实例放在同一个文件中时,没有将其识别为上述代码中的重新实现。此外,如果从cowboy中删除新的_实例,rider中的新_实例仍然不会显示在doxy

其他可能有用的信息。我拥有的codeblocks版本是32位应用程序,您可以直接从codeblocks的网站下载。操作系统是Mountain Lion,以防此问题特定于该版本的操作系统

原来问题是由于将继承结构放在同一个文件中引起的。我不确定它是.h文件还是.cpp文件是否重要。在我的例子中,我使用的是一个.cpp文件。问题是,doxygen在将新的_实例放在同一个文件中时,没有将其识别为上述代码中的重新实现。此外,如果从cowboy中删除新的_实例,rider中的新_实例仍然不会显示在doxygen创建的html文件中。要解决此问题,需要将每个类拆分为.h/.cpp文件。分割后,doxygen创建的html文件可以正常工作