Qt Creator: Getting error “skipping incompatible” when include library
-
I'm about to include a library in my Qt project. The library is included with success, but I got the following errors:
*
(This is the old version, beneath the line "------------------------" there is the new one).*@:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libcrypto.so when searching for -lcrypto (the following is in red colour) File not found: (which one isn't told)
:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libcrypto.a when searching for -lcrypto (the following is in red colour) File not found: (which one isn't told)
:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libpthread.so when searching for -lpthread (the following is in red colour) File not found: (which one isn't told)
:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libpthread.a when searching for -lpthread (the following is in red colour) File not found: (which one isn't told)
:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libm.so when searching for -lm (the following is in red colour) File not found: (which one isn't told)
:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libm.a when searching for -lm (the following is in red colour) File not found: (which one isn't told)
:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libc.so when searching for -lc (the following is in red colour) File not found: (which one isn't told)
:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib//libc.a when searching for -lc (the following is in red colour) File not found: (which one isn't told)@I added the libraries in the .pro-file using the "add library" function and choosed "external library". I got the following code:
@unix:!macx:!symbian: LIBS += -L$$PWD/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib/ -lcrypto
INCLUDEPATH += $$PWD/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/openssl
DEPENDPATH += $$PWD/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/opensslunix:!macx:!symbian: PRE_TARGETDEPS += $$PWD/../../../../opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib/libcrypto.a
@
Actually my programm works, but I don't understand what Qt is doing. It seem like Qt is trying to include other libraries with similar names (but why?) and doesn't succed.
I had some more "libcrypto" libraries in my folder - with a different ending (.so, ...)). I isolated libcrypto.a (the one i need). No I get only one error:
[code]:-1: error: skipping incompatible /home/administrator/yyyyy/xxxxx/../Library//libcrypto.a when searching for -lcrypto.[/code]
Unfortunately this is the library I need - and strangely the one I use (and the programm works).
On another forum ("http://stackoverflow.com/questions/8927778/qt-creator-getting-error-skipping-incompatible-when-include-library ":http://stackoverflow.com/questions/8927778/qt-creator-getting-error-skipping-incompatible-when-include-library )there was the assumption there could be a x64 and x86 library on the system. Is that possible? -
Skipping incompatible usually means the library has the wrong architecture.
Indeed, it could be that "libcrypto.a" is in more than one directory in your path, and the first file the linker finds can't be linked because the architecture doesn't match with your program. Then it finds another "libcrypto.a" in your path, and this one's architecture matches, thus the program runs.
I don't have an actual answer on how to solve that... What are you trying to build? A 64 bits or 32 bits application? An ARM application for MeeGo/Harmattan? Have you tried to search all the libraries path to see if there's more than one libcrypto? Maybe you're not linking with the one you think...
-
Probably the problem is that the library is built for an ARM-Microcontroller: readelf -h librcrypto.a shows (among other things): "Machine: ARM". In one or two weeks I can ask s.o. who has set up this library - so you doesn't need to answer anymore.