I am writing an application that supports plugins. In the application itself, an instance of a certain class ( MyQObject ) is used.

It is necessary that any plug-in has access to public methods of this class. The problem is that in runtime when you try to call an instance method of this class, it leads to an error

"... symbol lookup error ... undefined symbol: _ZN9MyQObject9testCalllEv".

NB: In the plugin method, a link to the class instance is passed and the method is called (leads to an error). Moreover, the value of the property of the class instance gets no problem.

Code showing the error (Qt4) can be found here: github

    1 answer 1

    If you just connect the header file and declare a link to the class, then for some reason, the symbol table for this class is not created.

    The problem is solved by moving the MyQObject class to a separate library and using this library in the program and the plugin.

    How to use and write libraries: https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application/ru