Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [Solved] Plugin depending on a shared lib problem

    General and Desktop
    2
    6
    1597
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Guigui last edited by

      Hi,

      I am trying to implement a Qt plugin built around a framework, in a shared library. Basically, the framework defines abstract types and mechanisms for Nodes creation, linkage and communication between those nodes. Different Qt plugins would be created to implement concrete node definitions and be used as a factory to provide these nodes to the client application.

      I am having some problems loading the plugin in the client application. I get the famous "Cannot load library /workspace/projects/shootbox_plugin/trunk/plugins/libsb-ipmdl.so: (/workspace/projects/shootbox_plugin/trunk/plugins/libsb-ipmdl.so: undefined symbol: _ZTI9NodeDatum)" and have no idea what to do. The undefined symbol, NodeDatum, is an abstract class from the framework lib.

      Would you have any idea about what would cause this or I did that I shouldn't have done?
      By the way, yes, my plugin interface is all pure virtual.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Check that the library containing that symbol can be found when you start your application. i.e use ldd on your plugin to see if it can find all dependencies

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • G
          Guigui last edited by

          Hi,
          Thank you for your answer and sorry for the late reply. An accident made me lose 2 weeks of work on this and I had to start over again...

          I just got to this point where I was stuck and, unfortunately, the dependencies seem to be resolved correctly. That does not seem to be the problem.

          EDIT: Found some issues with some abstract type definitions (still a bit new to C++...). I am now stuck with an "Unknown error" which I have no clue how to debug.

          1 Reply Last reply Reply Quote 0
          • G
            Guigui last edited by

            I managed to make it work although I still get the "Unknown error" message.

            I am not familiar at all with the Qt source code, but digging into the source code of the QPluginLoader class, I found this:

            @QString QPluginLoader::errorString() const
            {
            return (!d || d->errorString.isEmpty()) ? tr("Unknown error") : d->errorString;
            }@

            Do I understand correctly that if the errorString is empty, "Unknown error" is thrown to the user instead of "No error" or something like that?!

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              Indeed, but it's not necessarily wrong.

              I.E. If load returns true, you don't have to check the error string. But if it return false and the error string is empty, then it's an unknown error.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply Reply Quote 0
              • G
                Guigui last edited by

                Right. Well, thank you, I consider this solved!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post