[SOLVED] Add external C lib (zeromq) to project that will run on android
-
Thanks for the hint. But again configuring it that way works with compiling for the desktop, but not for android.
What I did:
I replaced the LIBS configuration I posted aboth with this:
@INCLUDEPATH += $$PWD/../../../../../usr/local/include
DEPENDPATH += $$PWD/../../../../../usr/local/include
LIBS += $$PWD/../../../../../usr/local/lib/libzmq.a@Now I get the following error:
@ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/qtappzmq/../../../../../usr/local/lib/libzmq.a(libzmq_la-zmq.o): incompatible target
../zmq/main.cpp:18: error: undefined reference to 'zmq_ctx_new'
../zmq/main.cpp:19: error: undefined reference to 'zmq_socket'
../zmq/main.cpp:20: error: undefined reference to 'zmq_connect'
../zmq/main.cpp:21: error: undefined reference to 'zmq_setsockopt'
collect2: error: ld returned 1 exit status
make: *** [libzmq.so] Error 1
15:31:50: The process "/usr/bin/make" exited with code 2.@I should add, that I am quite a newbie to the whole c library stuff. So if you think I have missed something simple, dont hesitate and point to it :)
-
Like that it doesnt work with the desktop and with the android compilation :)
I get the following error while compiling for desktop:
@/usr/bin/ld: cannot find /home/qtappzmq/../../../../../usr/local/lib/: File format not recognized
collect2: ld returned 1 exit status
make: *** [zmq] Error 1
15:41:52: The process "/usr/bin/make" exited with code 2.@And this error while compiling for android:
@ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: fatal error: /home/qtappzmq/../../../../../usr/local/lib/: pread failed: Is a directory
collect2: error: ld returned 1 exit status
make: *** [libzmq.so] Error 1
15:45:46: The process "/usr/bin/make" exited with code 2.@bq. Btw, is zeromq supposed to work on android?
I naivly thought it should, because its just some c code.
-
Getting the same errors for desktop and android :/
-But I found a source for zmq and android. Seems like I have to make a special build for android:-
-http://zeromq.org/build:android-edit: Ok that was about building a jar in order to use zeromq, but since I'd like to use it directly as a C lib with my QT app it might work just like that, if I could only configure it correctly...
-
It is the same error, but the dir is now the absolute and not the relative one.
Now it is:
@/usr/bin/ld: cannot find /usr/local/lib/: File format not recognized@ instead of
@/usr/bin/ld: cannot find /home/qtappzmq/../../../../../usr/local/lib/: File format not recognized@ -
Yap, it builds for the desktop compile target like that, but for the android compile target I get the "incompatible target" error again, which I showed detailed in my second post.
I think there is something special to do for the android compile target, that I forget.
-
Hi,
Are you linking against an ARM version of libqmq when you build for android ?
-
Ye, thats what I already asked. You cant expect a desktop lib to work on android. The libraby might be using some other libraries that arent available on android.
http://zeromq.org/build:android
It creates some libraries and a java wrapper. Maybe you can just bind the libs to your app