rekire
rekire

Reputation: 47965

Javadoc internal links don't work in doxygen

I'm wondering what I am doing wrong I cannot use normal {@link #someMethod} and similar links. Here take this example code:

/**
 * ... you might be interested in overriding {@link #foo()} like in
 * {@link MyClass#bla() MyClass42}. Keep in mind to implement...
 * Created on 08.01.2016.
 *
 * @author me
 */
public abstract class MyClass {
    int foo() {
        return 42;
    }

    abstract void bla();
}

In the console I get this error:

MyClass.java:3: warning: unable to resolve link to `#foo()' for \link command
MyClass.java:4: warning: unable to resolve link to `MyClass#bla()' for \link command

What am I doing wrong?

I also checked multiple half dubs on Stack Overflow, but none of them matched for internal links or gave a proper solution.

Upvotes: 0

Views: 278

Answers (1)

rekire
rekire

Reputation: 47965

I just found out the reason. I had two bugs in my example:

  • The methods where not public (but this was not the real reason)
  • The methods had no javadoc!

Here is the working code:

public abstract class MyClass {
    /** Returns 42. */
    public int foo() {
        return 42;
    }

    /** Just an example. This does nothing at all! */
    public abstract void bla();
}

With those documentation the links work.

Upvotes: 1

Related Questions