It's possible but requires hacking at the mingw-w64 source files
themselves and if you even look at the toolchain wrong it won't work.
That is of course provided nothing has changed since I've last done this
(I don't think it has).
Both 32 and 64-bit should work provided it didn't detect your eyes
staring at it. You shouldn't have to rename the libs, you can either
specify the *.a files as additional lib dependencies in msvc or use the
#pragma comment(lib, "libherpderp.a") somewhere in your source.
Unless there's a dependency that you don't have a choice but to build it
with gcc (e.g. ffmpeg) then I wouldn't recommend trying it. Either make
an attempt to stay on the mingw toolchain or use msvc before attempting
the hackary that is using mingw in msvc.
On Sat, Aug 25, 2012 at 2:57 AM, Ruben Van Boxem
<[email protected]>wrote:
> 2012/8/24 Alex Loukissas <[email protected]>
>
>> Hello,
>>
>> I was wondering whether it is possible to use static libraries built with
>> mingw (e.g. libz) in a Visual C++ and link against them.
>>
>> To explain the motivation behind this: in my current setup, I'm using
>> mingw to build both my application and my toolchain (which comprises of a
>> number of libraries, which I link my application against). I would like to
>> move to MSVC++ for my application development but would like to reuse the
>> toolchain built using mingw.
>>
>> Any help is much appreciated!
>>
>
> The easiest way to see is to rename e.g. libz.a to zlib.lib or something
> and try using it from VS. It should work (at least for 32-bit, 64-bit is a
> definite no-go).
>
> See also for example here:
> http://stackoverflow.com/a/2139061/256138
>
> Note that C++ will not work, plain C should be fine.
>
> Ruben
>
>
>
>>
>>
>
>> Thanks,
>> Alex Loukissas
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Mingw-w64-public mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
>>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public