Doxygen not documenting main function in main.cpp

前端 未结 4 1067
长发绾君心
长发绾君心 2020-12-31 02:49

I have a main.cpp that contains a struct, some global constants and a main function.

I ran doxygen and the only documentation I am getting in the output index.html i

4条回答
  •  旧时难觅i
    2020-12-31 03:17

    This is because you are documenting a global object which doxygen, by default, does not document. From the doxygen manual (emphasis mine):

    To document a member of a C++ class, you must also document the class itself. The same holds for namespaces. To document a global C function, typedef, enum or preprocessor definition you must first document the file that contains it (usually this will be a header file, because that file contains the information that is exported to other source files).

    Let's repeat that, because it is often overlooked: to document global objects (functions, typedefs, enum, macros, etc), you must document the file in which they are defined. In other words, there must at least be a

    /*! \file */ 
    

    or a

    /** @file */ 
    

    line in this file.

    So try adding one of the above two lines to your main.cpp file.

提交回复
热议问题