Discussion:
.a to .lib converting
Alireza Ghasemi
2005-05-25 10:18:15 UTC
Permalink
Hello,
I want to use some cygwin .a libraries with other environments(like VC++) as
static .lib files.is this possible?Can I convert .a files to windows static
libraries?
If possible,what program do I need?
Thanks.
Igor Pechtchanski
2005-05-25 13:21:18 UTC
Permalink
Post by Alireza Ghasemi
Hello,
I want to use some cygwin .a libraries with other environments(like VC++) as
static .lib files.is this possible?
Yes.
Post by Alireza Ghasemi
Can I convert .a files to windows static libraries?
Yes.
Post by Alireza Ghasemi
If possible,what program do I need?
This was discussed before, though I'm not sure what the correct search
terms would be. I believe you can simply use "mv libblah.a libblah.lib".
<http://cygwin.com/faq/faq_3.html#SEC103> might help, too.
Igor
P.S. Your space key seems to be malfunctioning...
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
Larry Hall
2005-05-26 01:24:21 UTC
Permalink
Post by Igor Pechtchanski
Post by Alireza Ghasemi
Hello,
I want to use some cygwin .a libraries with other environments(like VC++) as
static .lib files.is this possible?
Yes.
Or no. ;-)
Post by Igor Pechtchanski
Post by Alireza Ghasemi
Can I convert .a files to windows static libraries?
Yes.
Or no. ;-)
Post by Igor Pechtchanski
Post by Alireza Ghasemi
If possible,what program do I need?
This was discussed before, though I'm not sure what the correct search
terms would be. I believe you can simply use "mv libblah.a libblah.lib".
<http://cygwin.com/faq/faq_3.html#SEC103> might help, too.
Igor
Actually, this is the answer to the opposite question. The answer to that
is as the FAQ states. Using Cygwin .a's with VC++ isn't as easy, since
they are going to pull in 'cygwin1.dll' and this cannot currently be
initialized properly by non-cygwin programs. Of course, this subject
has also be discussed in the email archives. If interested, Alastair
Growcott suggested a "workaround". If you're interested in it, see
<http://sources.redhat.com/ml/cygwin/2004-06/msg00274.html>. I'd
recommend directing questions about this to him, though it's worthwhile
to cc the list for posterity. :-)
Post by Igor Pechtchanski
P.S. Your space key seems to be malfunctioning...
Yeah, I noticed that. :-)


--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
838 Washington Street (508) 893-9889 - FAX
Holliston, MA 01746
Igor Pechtchanski
2005-05-26 04:47:23 UTC
Permalink
Post by Larry Hall
Post by Igor Pechtchanski
Post by Alireza Ghasemi
Hello,
I want to use some cygwin .a libraries with other environments(like
VC++) as static .lib files.is this possible?
Yes.
Or no. ;-)
Eh? Your response below points to a "yes", AFAICS...
Post by Larry Hall
Post by Igor Pechtchanski
Post by Alireza Ghasemi
Can I convert .a files to windows static libraries?
Yes.
Or no. ;-)
Ditto.
Post by Larry Hall
Post by Igor Pechtchanski
Post by Alireza Ghasemi
If possible,what program do I need?
This was discussed before, though I'm not sure what the correct search
terms would be. I believe you can simply use "mv libblah.a
libblah.lib". <http://cygwin.com/faq/faq_3.html#SEC103> might help,
too.
Igor
Actually, this is the answer to the opposite question. The answer to
that is as the FAQ states.
Umm, right. That's why I said "might help" rather than point the OP
directly to it... :-)
Post by Larry Hall
Using Cygwin .a's with VC++ isn't as easy, since they are going to pull
in 'cygwin1.dll' and this cannot currently be initialized properly by
non-cygwin programs. Of course, this subject has also be discussed in
the email archives. If interested, Alastair Growcott suggested a
"workaround". If you're interested in it, see
<http://sources.redhat.com/ml/cygwin/2004-06/msg00274.html>.
Ah, yes, this is exactly the message I was thinking of (though I didn't
recall it being this complicated). Thanks for including a pointer to it.
BTW, we're talking about linking C here, not C++. The name mangling
differences will make C++ linking much more painful, IIUC.

FWIW, someone else has mentioned working on the DLL initialization code
quite recently -- he might benefit from this pointer as well.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
Larry Hall
2005-05-26 19:19:25 UTC
Permalink
Post by Igor Pechtchanski
Post by Larry Hall
Post by Alireza Ghasemi
Hello,
I want to use some cygwin .a libraries with other environments(like
VC++) as static .lib files.is this possible?
Yes.
Or no. ;-)
Eh? Your response below points to a "yes", AFAICS...
I guess it depends on your level of expertise. VC++ .lib libraries can be
used directly, without any fuss (standard exclusion for C++ linkage and
some inevitable oddities of course). The reverse requires lots of
fiddling/hacks though and is not part of Cygwin proper. That's why I said
no. Also, while the FAQ entry you pointed to gives a few alternatives for
linking against .lib libraries from gcc/g++, it says nothing about the
reverse. So my response was meant as a clarification and to point out the
difference in ease of going one way versus the other. I just didn't think
that was clear from your post (or maybe it was but wasn't clear to me ;-) ).
In any case, it sounds like you and I are in violent agreement on this
subject so I think our work is done. ;-)



--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
838 Washington Street (508) 893-9889 - FAX
Holliston, MA 01746

Continue reading on narkive:
Loading...