Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Relocation error when loading shared object
QtWS25 Last Chance

Relocation error when loading shared object

Scheduled Pinned Locked Moved Solved C++ Gurus
linkerloaderc++symborelocation
5 Posts 2 Posters 3.8k Views
  • 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.
  • K Offline
    K Offline
    kshegunov
    Moderators
    wrote on 22 Sept 2016, 20:37 last edited by kshegunov
    #1

    Well that's about it. I get

    /home/nye/Programming/C++/qtdaemon/examples/daemon/customcontrol/customcontroller/customcontroller:
    relocation error
    symbol _ZTVN8QtDaemon17QDaemonControllerE, version Qt_5 not defined in file libQt5Daemon.so.0 with link time reference
    

    from the loader and I'm at a loss why. The symbol is present in the library mentioned, marked as a weak object for some reason. nm output:

    0000000000018a68 V _ZTVN8QtDaemon17QDaemonControllerE
    

    Any suggestions on reason or solution?

    Read and abide by the Qt Code of Conduct

    1 Reply Last reply
    0
    • H Online
      H Online
      hskoglund
      wrote on 22 Sept 2016, 21:08 last edited by
      #2

      Hi I've seen this when one .cpp includes qglobal.h and another one does not. It's the new qversiontagging.h file that defines a qt_version_tag symbol, like your Qt_5 above...

      K 1 Reply Last reply 22 Sept 2016, 21:23
      2
      • H hskoglund
        22 Sept 2016, 21:08

        Hi I've seen this when one .cpp includes qglobal.h and another one does not. It's the new qversiontagging.h file that defines a qt_version_tag symbol, like your Qt_5 above...

        K Offline
        K Offline
        kshegunov
        Moderators
        wrote on 22 Sept 2016, 21:23 last edited by kshegunov
        #3

        Thanks Henry! You're right the qt_version_tag symbol is marked as undefined, I wonder why however. I've checked, and all my headers are including QtCore/qglobal.h through my own global header (where I define the export/import macros).

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 22 Sept 2016, 21:38 last edited by
          #4

          Now I feel really, really stupid!

          So the whole problem was that the example application links against my module, but when the loader runs it uses another copy of the library (and old one). The old copy for unfathomable reasons I'd installed to the system location, and because the library is binary compatible it would work ... mostly ... until I started changing the ABI and the example application links against the new and changed binary interface ... thus we arrive here ...

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          1
          • H Online
            H Online
            hskoglund
            wrote on 22 Sept 2016, 21:48 last edited by
            #5

            Ha I know the feeling, like me before, thinking ".. that stupid Qt, why doesn't this work, why are they so dumb..." oooh, it helps to run qmake again :-)

            1 Reply Last reply
            3

            5/5

            22 Sept 2016, 21:48

            • Login

            • Login or register to search.
            5 out of 5
            • First post
              5/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved