Thank you for your answer.

My problem is that in my code I use standard libraries from GCC (libquadmath, libgcc, etc), which were compiled together with GCC with link to MSVCR.
I guess "specs" file cannot save the situation. Full re-compilation is needed (?).

Sorry for unclear explanation in my first message. I did test "specs" before writing to the mail-list.

On Tue, Oct 16, 2012 at 8:50 PM, Earnie Boyd <> wrote:
On Tue, Oct 16, 2012 at 4:54 AM, Pavel Holoborodko wrote:
> Hello,
> I need to use DLLs generated by MinGW/GCC 4.7.0 in Visual Studio 2010
> application.
> As expected, different runtimes living in one process lead to unpredictable
> results.

And this result is documented on MSDN.

> In connection with this, I would greatly appreciate any help on how to build
> MinGW/GCC (4.7.0) with initial support of MSVCR100 runtime (instead of
> msvcr.dll).

Does LIBS=-lmsvcr100 not work for you?

> Now, using "specs" file I can force GCC to produce DLL with MSVCR100.
> However, I have to recompile GCC from the scratch, so that  GCC-specific
> libraries also rely on MSVCR100.
> (I use them in my code, like libquadmath, etc.).

No you do not need build GCC just for a new specs file.  You can state
the specs file location on the command line (-specs=<file>) or you can
place the specs file where GCC expects to find it.  For MinGW assuming
you have installed in C:\MinGW, you are using MSYS with C:/MinGW
mapped to /mingw and your GCC version is 4.7.0 then you place the
specs in the /mingw/lib/gcc/mingw32/4.7.0 directory.

To get the original specs file you can use -dumpspecs option to gcc
and redirect the output to a file.

> Any pointers/references/step-by-step guides on how to re-compile MinGW/GCC
> 4.7.x with MSVCR100 would be much appreciated.
> (Or at least detailed manual on how to build GCC for MinGW.)

You don't need to so I won't give those here.  The source package
comes with a build process but there are a number of dependency
libraries you'll need.  We supply those as well, you just need to
install the -dev package for them.


Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
MinGW-users mailing list

This list observes the Etiquette found at
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at: