Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Trouble with a "Shared Library" from another project
Forum Updated to NodeBB v4.3 + New Features

Trouble with a "Shared Library" from another project

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 4.0k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    haller
    wrote on last edited by
    #1

    Hi everyone,

    I'm trying to use a methode from another subproject from my qt project.

    For the Subproject, I use "TEMPLATE = lib" and "DEFINES += MYSHAREDLIB_LIBRARY". The Methode is marked for export like in "http://doc.trolltech.com/4.5/sharedlibrary.html":http://doc.trolltech.com/4.5/sharedlibrary.html.

    There is no error on build process, but while runtime the programm crashed an I get this message:

    @mainwindow: symbol lookup error: @
    and
    @libxmltester.so: undefined symbol: _ZN11ErrorWidgetC1E7QString@

    Is there anyone who knows how to fix this problem? Im thankful for every advice.

    Best greetings,
    haller

    1 Reply Last reply
    0
    • H Offline
      H Offline
      haller
      wrote on last edited by
      #2

      Oh sorry,

      my configuration is:

      OS: Debian Lenny

      Qt: 4.6

      Qt Creator: 2.0

      Best greetings,
      haller

      1 Reply Last reply
      0
      • H Offline
        H Offline
        harryF
        wrote on last edited by
        #3

        First, check whether the symbol is in the exported section of libxmltester.so:

        nm -D | grep _ZN11ErrorWidgetC1E7QString

        If it's not there, make sure that you link the *.o file where it's declared into your lib. You can check in which *.o file your symbol ends up by using nm on all *.o files, e.g.

        find . -name "*.o" | xargs nm -o | grep _ZN11ErrorWidgetC1E7QString

        // happy hacking

        1 Reply Last reply
        0
        • H Offline
          H Offline
          haller
          wrote on last edited by
          #4

          Hi.

          thanks for your reply.

          You are right, the Command
          @nm -D | grep _ZN11ErrorWidgetC1E7QString@

          doesn't return anything. So I tried to link the correct object file "errorwidget.o":

          @OBJECTS += [...]errorwidget.o@

          But while runtime the program crashed and the same errormessage raises:

          @undefined symbol: _ZN11ErrorWidgetC1E7QString@

          Best greetings,
          haller

          1 Reply Last reply
          0
          • H Offline
            H Offline
            harryF
            wrote on last edited by
            #5

            [quote author="haller" date="1279789507"]Hi.
            @OBJECTS += [...]errorwidget.o@
            [/quote]

            Instead of adding the object file to OBJECTS, I suggest adding errorwidget.cpp to SOURCES...

            // happy hacking

            1 Reply Last reply
            0
            • H Offline
              H Offline
              haller
              wrote on last edited by
              #6

              Whooohoo. That works :-) Thanks a lot.

              1 Reply Last reply
              0

              • Login

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