Doxygen won't process main.cpp
Asked Answered
C

3

6

So I'm new to using Doxygen and I was able to get it to work smoothly. I was able to document my classes and structs and it generates the HTML files perfectly. The issue I'm running into is it won't parse my main.cpp file. All the classes and structs have their own .h and .cpp files and they process fine. How do I get Doxygen to make the documentation for main.cpp? It doesn't have a .h file as this is where the program starts and ends. I wouldn't even know what to put in the .h file for main. I'm using Doxywizard in Windows.

Edit:

I put this in main and it generates a main page:

/**
@mainpage

This is a test application.

@author Alex
@date 10/21/2010
@version 1.0
*/

But then farther down the file where the function prototypes are I have this and it doesn't get parsed:

/**
@brief Error handler for the PDF writer.

It does nothing. It just has to exist.
*/
void error_handler (HPDF_STATUS   error_no,
                    HPDF_STATUS   detail_no,
                    void         *user_data)
{
}
Cadell answered 21/10, 2010 at 18:8 Comment(3)
Does main even need documentation? Usually, it's just setting a few things up, maybe calling the function that parses command line args, and then call some function.Bucko
It's probably related to a mask you have in your Doxygen config file. Can you post the content of your INPUT and FILE_PATTERNS config values?Humbert
Both INPUT and FILE PATTERNS are empty. Basically I installed the program, found my project, and pressed "Run". I suppose main doesn't need to be commented, but there are other functions in the same file that are used and need to be commented.Cadell
C
7

I put this at the top of main.cpp and it worked. Go figure.

/**
@file main.cpp
*/
Cadell answered 22/10, 2010 at 19:33 Comment(2)
You, sir, just saved me a few more hours of searching. Thanks a bunch. Do you have any idea why it NEEDS an @file command ?Sachiko
You don't need "main.cpp". @file is enough. You need that because you don't have any class or structure documented in that file.Muir
H
2

If INPUT and FILE_PATTERNS are empty, it should search for *.cpp files (and many other patterns) in the current directory. (This from the doxygen manual.)

Since yours are empty, I expect one of two things is going on if you're not getting main.cpp documentation:

  1. main.cpp is not in the current directory. To rule this out, make sure you're running doxygen from the same directory as both your config file and main.cpp.
  2. There is a syntax error in your main.cpp documentation. These can be tricky to spot, as doxygen doesn't generally abort when it encounters an error - instead it just skips ahead. If this is the problem, comb through doxygen's output when you generate your docs line by line.

If neither of these ideas solve your problem, we might need more information. Output of ls -R, output of the doxygen run, etc. Good luck!

Humbert answered 21/10, 2010 at 20:18 Comment(1)
main.cpp is in the folder that Doxygen is looking in and it doesn't show any errors in the output, just warnings from the other classes which is still processes correctly. I added some more information to my question above.Cadell
S
1

I did some research on this... From the doxygen manual :

Important: The documentation of global functions, variables, typedefs, and enums will only be included in the output if the file they are in is documented as well.

There you go !

Sachiko answered 13/4, 2011 at 18:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.