This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: req: using cygwin's gcc for creating static libs in msvc binary format (.a => .lib) # Re: static MSVC library?
On Wed, Mar 09, 2005 at 07:48:58PM -0800, Tim Prince wrote:
>At 12:01 PM 3/9/2005, Christopher Faylor wrote:
>
>>A foo.lib can be used interchangeably with a libfoo.a file. Except
>>for the well-documented and frequently repeated problems with C++
>>name mangling, and the even more repeated problems with mixing
>>the cygwin and msvcrt runtime libraries, there should be no problems
>>with using a .lib file on the gcc command line or a .a file on the
>>"cl" command line.
>>
>>In fact, I just tried it. I created two MSVC object files, put them
>>in a .lib, and linked them with a program that I compiled using
>>gcc -mno-cygwin.
>>
>>Then I put the same two files in a ".a" and linked them using "cl". You
>>will have to play around with the right libraries required to satisfy
>>things that mingw adds to an object file if you want to use msdev for
>>linking but this is not an insurmountable problem.
>>
>>Getting this working with object files compiled without -mno-cygwin
>>would be tricky (and maybe even not possible) but it's certainly
>>possible to use msvc created .lib files with gcc and gcc/ar created .a
>>files with msvc.
>
>When cygwin is used as a build environment for plain Windows compilers
>(e.g. CL, IFORT), it insists on making libraries with its own ar
>tool. I've found it quite difficult to persuade it to use lib. Maybe
>because the Makefile wants to use the alias AR for lib, and we run afoul of
>case insensitivity.
"It insists"?
"The Makefile"?
"the alias AR for lib"?
>64-bit objects in a library built by ar,
"64-bit objects"?
>BTW, I want to thank whoever made it so that cygwin runs right out of setup
>now on the 64-bit Windows 180-day trial version. No more editing of
>cygwin.bat.
Uh. Yeah. No more editing.
I want to point out that cygwin likes pie both in the 32-bit and 64-bit variety.
cgf
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/