undefined ELF header when porting .so file from cygwin to linux
Hi all, I'm facing a problem for which there were not much help. I have created a .so file in cygwin since the programs used windows.h and a .lib file. After having created this .so file, I used it in a jni link. Previously, a .dll was created which was used in a jni link, but now I need the equivalent .so for linux, which I have obtained in cygwin with: g++ *.o scard.lib -o libscard.so. Now I'm trying to use it in Red Hat Linux, but get this error: Exception in thread main java.lang.unsatisfiedLinkError:/pathname of LD_LIBRARY_PATH to .so/ invalid ELF header. The command send was a simple java main from which call the .so file. Can someone help me in removing this ELF error message. I have tried to do everything in Linux. I have been able to obtain the .o files after including the windows header files, but then to create the .so which needed scard.lib, it gave me error messages. I believe that i cannot use the .lib file properly in linux, but in cygwin, there is no complaint. So I have to get this .so in cygwin and java should not complain in linux when I use this .so Thanks, Alfred gcc.cpp Description: Binary data -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
FW: undefined ELF header when porting .so file from cygwin to linux
Oringinal unfortunatelly sent private ... :( -Original Message- From: Schaible, Jörg Sent: Tuesday, November 05, 2002 9:56 AM To: 'Alfred Lam' Subject: RE: undefined ELF header when porting .so file from cygwin to linux Hi Alfred, which I have obtained in cygwin with: g++ *.o scard.lib -o libscard.so. Just setting the name did not change the format. This is still a normal DLL. You will have to use cross-compilation and linking to do so. Regards, Jörg -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: undefined ELF header when porting .so file from cygwin to linux
Hello Alfred, sorry, I just *know* it, but I do not know how to do it. But I am quite sure, that someone at the list will help. You might find additionally a lot of examples looking into the archives (or try google at site:cygwin.com). Regards, Jörg -Original Message- From: Alfred Lam [mailto:alfredlam;nowmediatech.com] Sent: Wednesday, November 06, 2002 2:13 AM To: Schaible, Jörg Subject: Re: undefined ELF header when porting .so file from cygwin to linux Can you give me an example of how to go about doing it using these files(e.g a.cpp, b.cpp, a.h,b.h,scdll32.lib) Thanks, Alfred -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: undefined ELF header when porting .so file from cygwin to linux
On 11/5/2002 4:47 PM, Alfred Lam wrote: I need the equivalent .so for linux, which I have obtained in cygwin with: g++ *.o scard.lib -o libscard.so. Now I'm trying to use it in Red Hat Linux, [Boggle!] You can't do that. Cygwin is not binary compatible with Linux - it's binary compatible with Windows. You cannot move a cygwin-compiled binary (executable or shared library) to Linux and use it there. You have to either compile it on Linux itself, or specifically compile it with a cross-compiler that creates Linux executables (which won't run on Windows, then). -- Shankar. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/