Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: using linux static library on windows

Reply
Thread Tools

Re: using linux static library on windows

 
 
Nyven
Guest
Posts: n/a
 
      12-24-2004
Okay, quick question... I need to write a wrapper dll, to access a *.a
file under windows. Is it even possible?

 
Reply With Quote
 
 
 
 
Joona I Palaste
Guest
Posts: n/a
 
      12-24-2004
Nyven <(E-Mail Removed)> scribbled the following:
> Okay, quick question... I need to write a wrapper dll, to access a *.a
> file under windows. Is it even possible?


Please ask in a Linux and/or Windows newsgroup.

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"Remember: There are only three kinds of people - those who can count and those
who can't."
- Vampyra
 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      12-24-2004
Nyven wrote:
> Okay, quick question... I need to write a wrapper dll, to access a *.a
> file under windows. Is it even possible?
>


Everything is possible with SOFTware, you have just to
bend it till it does what you want.

1: Open the .a file.
2: Extract each .o object file into a buffer.
3: Translate the fixups and code/data
sections into their windows equivalent, if any.
If you ignore the C++ stuff and the non-existing
translations, you obtain a COFF format object.
4: Write the COFF format object into a windows library.

Done.

Of course this will crash at runtime (or will not link)
if the code uses any external symbol (like fork()) that
doesn't exist under windows.

And even if it exists, the semantics can be slightly different.
Malloc and other external functions from glibc are
probably quite different from what the windows side is going
to offer, but anyway, who cares?

If the library is carefully written to run under windows
it is possible that a hack like this would work but then,

why not just recompiling under windows???

jacob
 
Reply With Quote
 
Tim Prince
Guest
Posts: n/a
 
      12-24-2004

"Nyven" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Okay, quick question... I need to write a wrapper dll, to access a *.a
> file under windows. Is it even possible?
>

No problem at all, if the .a file contains objects built to run on your OS.
Maybe you're implying they were built for some other OS. Figure out what you
want and which NG is appropriate.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
static library and dynamic library Even C Programming 6 10-20-2007 04:05 PM
Build libperl.so shared library from static library or source? DJ Stunks Perl Misc 0 02-10-2007 04:16 AM
Static library Vs. Dynamic library iceColdFire C++ 3 05-17-2005 06:16 AM
how to link static library to another static libraries free2cric@yahoo.com C++ 2 05-16-2005 04:40 PM
Dynamic Library or Static Library under Linux gouqizi.lvcha@gmail.com C++ 6 05-10-2005 03:16 PM



Advertisments