Link my Qt static library in to non Qt linux application
-
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 -
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
-
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?