Qt World Summit: Register Today!

Undefined Reference - But not Really

  • I have a very weird error. I get the following error when compiling (from Qt Creator)

    error: undefined reference to `Class::Method'
    collect2: error: ld returned 1 exit status

    The thing is however that Class::Method does exist and is also recognised by the autocompletion facility of Qt Creator. Any ideas what i might be doing wrong here?

  • Moderators

    this error means that either the implementation is missing or that the obj containing implementation is not linked into your binary.
    If you are sure that the implementation body is there, a simple rerun of qmake might already solve the problem.

  • Yep, that was it: implementation was missing. Thanks.

Log in to reply