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. Link my Qt static library in to non Qt linux application
QtWS25 Last Chance

Link my Qt static library in to non Qt linux application

Scheduled Pinned Locked Moved General and Desktop
librarystaticstatic linkingstatic library4.8non-qt
3 Posts 1 Posters 2.1k 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
    kumararajas
    wrote on last edited by
    #1

    Hello,

    I have build my Qt project as a static library and I have libabc.a

    I want to link this library with other non Qt application. (Example "test")

    I have used LIBPATH and set the path for my library.

    And used LIBS and passed -labc to for the linkage.

    But, when I build the application "test", While linking my Qt library, I get linker error:

    /home/kumararajas/Blah/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::connectCall(bool)':
    moc_telephonedelegate.cpp:(.text+0x60): undefined reference to `QMetaObject::activate(QObject*, QMetaObject const*, int, void**)'
    /home/kumararajas/Blah/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::qt_metacall(QMetaObject::Call, int, void**)':
    moc_telephonedelegate.cpp:(.text+0xb4): undefined reference to `QItemDelegate::qt_metacall(QMetaObject::Call, int, void**)'
    /home/kumararajas/Integrate_UI/G-CPU/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::qt_metacast(char const*)':
    moc_telephonedelegate.cpp:(.text+0x12c): undefined reference to `QItemDelegate::qt_metacast(char const*)'
    /home/kumararajas/Blah/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::~TelephoneDelegate()':
    moc_telephonedelegate.cpp:(.text._ZN17TelephoneDelegateD2Ev[_ZN17TelephoneDelegateD5Ev]+0x20): undefined reference to `QItemDelegate::~QItemDelegate()'
    

    Is there anything more that I need to do link my Qt static library?

    Thanks,
    Kumara

    --Kumar

    K 1 Reply Last reply
    0
    • K kumararajas

      Hello,

      I have build my Qt project as a static library and I have libabc.a

      I want to link this library with other non Qt application. (Example "test")

      I have used LIBPATH and set the path for my library.

      And used LIBS and passed -labc to for the linkage.

      But, when I build the application "test", While linking my Qt library, I get linker error:

      /home/kumararajas/Blah/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::connectCall(bool)':
      moc_telephonedelegate.cpp:(.text+0x60): undefined reference to `QMetaObject::activate(QObject*, QMetaObject const*, int, void**)'
      /home/kumararajas/Blah/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::qt_metacall(QMetaObject::Call, int, void**)':
      moc_telephonedelegate.cpp:(.text+0xb4): undefined reference to `QItemDelegate::qt_metacall(QMetaObject::Call, int, void**)'
      /home/kumararajas/Integrate_UI/G-CPU/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::qt_metacast(char const*)':
      moc_telephonedelegate.cpp:(.text+0x12c): undefined reference to `QItemDelegate::qt_metacast(char const*)'
      /home/kumararajas/Blah/lib/libuicorelib.a(moc_telephonedelegate.o): In function `TelephoneDelegate::~TelephoneDelegate()':
      moc_telephonedelegate.cpp:(.text._ZN17TelephoneDelegateD2Ev[_ZN17TelephoneDelegateD5Ev]+0x20): undefined reference to `QItemDelegate::~QItemDelegate()'
      

      Is there anything more that I need to do link my Qt static library?

      Thanks,
      Kumara

      K Offline
      K Offline
      kumararajas
      wrote on last edited by
      #2

      Further to this post,

      I continued with different tries.

      Later,

      I did try this:

       -lQtGuiE -lEGL -lIMGegl -lsrv_um -lQtNetworkE -lQtCoreE -lpthread 
      

      I linked the application "test" with my library and also with the above mentioned list.

      This solves the problem.
      Since the my Qt static library depends on other Qt libraries, i should link them as well..

      --Kumara

      --Kumar

      K 1 Reply Last reply
      0
      • K kumararajas

        Further to this post,

        I continued with different tries.

        Later,

        I did try this:

         -lQtGuiE -lEGL -lIMGegl -lsrv_um -lQtNetworkE -lQtCoreE -lpthread 
        

        I linked the application "test" with my library and also with the above mentioned list.

        This solves the problem.
        Since the my Qt static library depends on other Qt libraries, i should link them as well..

        --Kumara

        K Offline
        K Offline
        kumararajas
        wrote on last edited by
        #3

        But this time, I have a different error:

        /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: /home/kumararajas/Integrate_UI/G-CPU/lib/libuicorelib.a(uicontroller.o): undefined reference to symbol '__cxa_begin_catch@@CXXABI_1.3'
        /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: note: '__cxa_begin_catch@@CXXABI_1.3' is defined in DSO /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf/libstdc++.so.6 so try adding it to the linker command line
        /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf/libstdc++.so.6: could not read symbols: Invalid operation
        collect2: error: ld returned 1 exit status
        make[4]: *** [bin/FireApp] Error 1
        make[3]: *** [libraries] Error 2
        make[2]: *** [libraries] Error 2
        make[1]: *** [libraries] Error 2
        

        This looks like standard library compatibility issue.

        Any thoughts on this?

        --Kumar

        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