Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I haven't used Doxygen that much, but after checking the documentation and looking around online, it looks like the reason this might be happening is because the SHOW_USED_FILES setting which (if I...
Answer
#4: Post edited
I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which (if I'm [reading the documentation](https://www.doxygen.nl/manual/config.html#cfg_show_used_files) correctly) is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.- In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
- I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this struct was generated from the following file:` line at the bottom of the generated documentation.
- Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
- For reference, here are the C files I used for my tests:
- **q12.h**
- ```
- #include <stdio.h>
- #include <string.h>
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR
- {
- Red, /*!< Enum value red. */
- Blue, /*!< Enum value blue. */
- Yellow /*!< Enum value yellow. */
- };
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors {
- char name[30]; /*!< Struct name. */
- };
- ```
- **q12.c**
- ```
- #include <stdio.h>
- #include "q12.h"
- int main()
- {
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR primary = Red;
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors Color1;
- strcpy(Color1.name, "Red");
- printf("Hello, world!\n");
- printf("Printing color: %d\n", primary);
- return 0;
- }
- ```
- I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the `SHOW_USED_FILES` setting which (if I'm [reading the documentation](https://www.doxygen.nl/manual/config.html#cfg_show_used_files) correctly) is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.
- In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
- I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this struct was generated from the following file:` line at the bottom of the generated documentation.
- Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
- For reference, here are the C files I used for my tests:
- **q12.h**
- ```
- #include <stdio.h>
- #include <string.h>
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR
- {
- Red, /*!< Enum value red. */
- Blue, /*!< Enum value blue. */
- Yellow /*!< Enum value yellow. */
- };
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors {
- char name[30]; /*!< Struct name. */
- };
- ```
- **q12.c**
- ```
- #include <stdio.h>
- #include "q12.h"
- int main()
- {
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR primary = Red;
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors Color1;
- strcpy(Color1.name, "Red");
- printf("Hello, world!\n");
- printf("Printing color: %d\n", primary);
- return 0;
- }
- ```
#2: Post edited
I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.- In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this `struct` was generated from the following file:` line at the bottom of the generated documentation.- Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
- For reference, here are the C files I used for my tests:
- **q12.h**
- ```
- #include <stdio.h>
- #include <string.h>
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR
- {
- Red, /*!< Enum value red. */
- Blue, /*!< Enum value blue. */
- Yellow /*!< Enum value yellow. */
- };
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors {
- char name[30]; /*!< Struct name. */
- };
- ```
- **q12.c**
- ```
- #include <stdio.h>
- #include "q12.h"
- int main()
- {
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR primary = Red;
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors Color1;
- strcpy(Color1.name, "Red");
- printf("Hello, world!\n");
- printf("Printing color: %d\n", primary);
- return 0;
- }
- ```
- I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which (if I'm [reading the documentation](https://www.doxygen.nl/manual/config.html#cfg_show_used_files) correctly) is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.
- In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
- I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this struct was generated from the following file:` line at the bottom of the generated documentation.
- Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
- For reference, here are the C files I used for my tests:
- **q12.h**
- ```
- #include <stdio.h>
- #include <string.h>
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR
- {
- Red, /*!< Enum value red. */
- Blue, /*!< Enum value blue. */
- Yellow /*!< Enum value yellow. */
- };
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors {
- char name[30]; /*!< Struct name. */
- };
- ```
- **q12.c**
- ```
- #include <stdio.h>
- #include "q12.h"
- int main()
- {
- // ref: https://docs.microsoft.com/en-us/cpp/c-language
- // /c-enumeration-declarations?view=msvc-160
- enum COLOR primary = Red;
- // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
- struct Colors Color1;
- strcpy(Color1.name, "Red");
- printf("Hello, world!\n");
- printf("Printing color: %d\n", primary);
- return 0;
- }
- ```
#1: Initial revision
I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs. In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files. I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this `struct` was generated from the following file:` line at the bottom of the generated documentation. Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work! For reference, here are the C files I used for my tests: **q12.h** ``` #include <stdio.h> #include <string.h> // ref: https://docs.microsoft.com/en-us/cpp/c-language // /c-enumeration-declarations?view=msvc-160 enum COLOR { Red, /*!< Enum value red. */ Blue, /*!< Enum value blue. */ Yellow /*!< Enum value yellow. */ }; // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm struct Colors { char name[30]; /*!< Struct name. */ }; ``` **q12.c** ``` #include <stdio.h> #include "q12.h" int main() { // ref: https://docs.microsoft.com/en-us/cpp/c-language // /c-enumeration-declarations?view=msvc-160 enum COLOR primary = Red; // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm struct Colors Color1; strcpy(Color1.name, "Red"); printf("Hello, world!\n"); printf("Printing color: %d\n", primary); return 0; } ```