.so library usage in Android Library
I want to use .so file in my Android Library, however when I try to use DLLImport, it gives that error:
libcyusb.so is not a valid elf. As I understand, I should compile my libcyusb which should work on Android OS. Which command should I use in Makefile? |
what does
Code:
file libcyusb.so |
libcyusb.so's output? It's a library which is written to wrap libusb library.
|
please run the file command on your file to see what it really is. e.g.:
Code:
[schneidz@hyper ~]$ file /usr/lib/libXext.so.6.4.0 |
Yes you're right, the output is "linker to libusb.so.1".
When I file libusb.so.1, its output is ELF 64-bit shared object. As far as I know, I can not use directly libcyusb.so.1 because its suffix is .1. So, how can I use libcyusb.so? |
i am not familiar with what you are trying to do but suffixes usually dont matter in linux. as long as the file is what it is expecting you can rename it to supercalifragilisticexpialidocious (what error are you getting ?).
also usually symbolic-links work as long as they refer to the correct item (thats kinda' the point of symbolic-links). but for the sake of crossing out variables maybe you can try importing the so. |
I'm trying to use .so file in the Xamarin, that's why I use DLLImport statements. I'm trying to add native library in Android Library in Xamarin and also use this Android Library in Android Application Project in Xamarin.
Now, I import the .so file, not create any .so.1, .so.2 files. g++ -fPIC -o lib/libcyusb.o -c lib/libcyusb.c g++ -shared -o libcyusb.so lib/libcyusb.o Those commands are true? Now, the output of libcyusb.so : libcyusb.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=eea583b4963ed7b949715e43f88714b58af23725, not stripped Can I use it in Android Library in Xamarin? |
Now, I used, it again gives the same error:
not a valid ELF executable Is there problem with libcyusb.so? For example, 64 bit or x86-64? |
not sure. this sounds like a very specific problem to the ximiran program you mention. also the dll makes me think is supposed to run on windows ? you mite need to contract them for support.
|
All times are GMT -5. The time now is 10:00 PM. |