[SOLVED] Add external C lib (zeromq) to project that will run on android
-
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.
-
Sorry, I didnt see that you were already using an absolute path.
It should look like this then:
@ INCLUDEPATH += /usr/local/include
DEPENDPATH += /usr/local/include
LIBS += /usr/local/lib/ -lzmq
@ -
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...
-
Are you sure that its the same error? I think it should be at least a little bit different.
-
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@ -
Like this it builds at least.
@LIBS += /usr/local/lib/libzmq.a
INCLUDEPATH += /usr/local/include
DEPENDPATH += /usr/local/includePRE_TARGETDEPS += /usr/local/lib/libzmq.a@
-
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 -
head -> wall I tried to link to the libzmq that i built for ubuntu. That sounds like reason for the "incompatible" error ;) Thanks!