Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-28-2014, 04:56 AM
|
#1
|
LQ Newbie
Registered: Oct 2014
Posts: 14
Rep:
|
.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?
|
|
|
11-28-2014, 11:33 PM
|
#2
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
|
|
|
11-29-2014, 11:05 AM
|
#3
|
LQ Newbie
Registered: Oct 2014
Posts: 14
Original Poster
Rep:
|
libcyusb.so's output? It's a library which is written to wrap libusb library.
|
|
|
11-30-2014, 05:09 PM
|
#4
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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
/usr/lib/libXext.so.6.4.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
i suspect that it is not really a shared object (you mention windows dll in your original post) or somehow corrupted ?
|
|
|
12-02-2014, 04:32 AM
|
#5
|
LQ Newbie
Registered: Oct 2014
Posts: 14
Original Poster
Rep:
|
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?
|
|
|
12-02-2014, 10:15 AM
|
#6
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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.
|
|
|
12-02-2014, 10:22 AM
|
#7
|
LQ Newbie
Registered: Oct 2014
Posts: 14
Original Poster
Rep:
|
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?
|
|
|
12-02-2014, 10:39 AM
|
#8
|
LQ Newbie
Registered: Oct 2014
Posts: 14
Original Poster
Rep:
|
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?
|
|
|
12-02-2014, 06:55 PM
|
#9
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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 04:43 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|