1

I have a с++ project that uses CMake to build. Doxygen is used as a documentation system. I have a warnings from Doxygen, and I can not understand why they appear.

Warnings

So, there are warnings:

.../cnumber.cpp:413: warning: documented symbol `CNumber & CNumber::operator &=' was not declared or defined.

.../cnumber.cpp:433: warning: documented symbol `const CNumber CNumber::operator &' was not declared or defined.

Source

And this is relevant part of header cnumber.h:

/*!
 * \brief operator&= - some description
 * \param[in] rv - some description
 * \return some description
 */
CNumber& operator&=(const CNumber& rv);
/*!
 * \brief operator& - some description
 * \param[in] rhs - some description
 * \return some description
 */
const CNumber operator&(const CNumber& rhs) const;

File cnumber.cpp contains definitions for that overloaded operators:

CNumber& CNumber::operator &=(const CNumber& rv)
{
    ...
    return *this;
}

const CNumber CNumber::operator&(const CNumber& rhs) const
{
    return CNumber(*this) &= rhs;
}

I overloaded other operators, but there are no such problems with them.

Doxygen

I used doxygen version 1.8.13. But I have installed 1.8.18 (4b5a3c19573ae5e9a6e6ade8aca9fbe9f307bbd2) now and warnings still appears.

CMake

In addition: I use Doxygen as a target in CMake like this:

find_package(Doxygen REQUIRED dot)

set(DOXYGEN_OUTPUT_LANGUAGE Russian)
set(DOXYGEN_GENERATE_LATEX YES)

doxygen_add_docs(doc ${CMAKE_CURRENT_SOURCE_DIR}/1/ ${CMAKE_CURRENT_SOURCE_DIR}/2/)

add_custom_target(doc_doxygen ALL
    COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile.doc
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    COMMENT "Generating API documentation with Doxygen"
    VERBATIM )
Community
  • 1
  • 1
Nikita
  • 11
  • 2
  • 1
    Not that familiar with Doxygen, but for some reason it is looking for member functions in class CNumber, while you declare the overloads to be external standalone functions. Since the error reported is in the cpp, can you show the relevant lines? – Lev M. Apr 04 '20 at 15:59
  • 1
    The code as shown does not provoke any Doxygen warnings. Please post a [mcve]. – n. m. could be an AI Apr 04 '20 at 16:25
  • The MWE as requested before should besides the relevant source code also contain the changes of the used doxygen configuration file compared to the default configuration file. Furthermore which version of doxygen are you using. – albert Apr 04 '20 at 16:50
  • With the given information I still don't get the warnings. Please provide the configuration differences (with master / 1.8.18 easy: `doxygen -x`) and also some minimal full class CNumber that shows the problem. – albert Apr 05 '20 at 08:51
  • I deleted my project from QtCreator and all build directories for it. Then I opened the project again and warnings are gone! it seems it’s not about Doxygen. – Nikita Apr 05 '20 at 10:42
  • Good that the problem has been "solved" for you. Probably some sort of caching effect? – albert Apr 05 '20 at 11:10

0 Answers0