Trouble with a "Shared Library" from another project



  • 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



  • Oh sorry,

    my configuration is:

    OS: Debian Lenny

    Qt: 4.6

    Qt Creator: 2.0

    Best greetings,
    haller



  • 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



  • 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



  • [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...



  • Whooohoo. That works :-) Thanks a lot.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.