← Back to team overview

kicad-developers team mailing list archive

Targeting MSVCR90.DLL c runtime with MinGW

 

I think this is worthy of another new thread, but is a fork of the Python
Scripting cmake build macros. There are some notes on using MinGW with
msvcr90.dll as a target C runtime.

I added a new specs file to my local KiCad MinGW install (see attached).
This goes in the <mingw-root>\lib\gcc\${VERSION}\ folder.

Then we need to compile using that specs file. Just use -specs=specs90 as a
compiler option. The default specs file for gcc is called specs. So if you
want the compiler to default to build for msvcr90 you can rename the
attached file to specs and you will not have to use the -specs= compiler
option.

The next problem is with msvcr80 onwards where executables require a
manifest. The executable will not run unless it has a manifest. Normally
the compiler embeds the manifest in the executable, but in MinGW's case
that doesn't yet happen, so you need a manifest file like the one attached,
named the same as the executable and suffixed with the extension .manifest.
For example for the executable test.exe you need to supply something like
the XML attached in a file called test.exe.manifest alongside the
executable.

There is some information about the manifest here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa374191(v=vs.85).aspx

Python 2.7 using msvcr90 as the runtime library. You can get the
re-distributable package from the following location if your system is
missing it: http://www.microsoft.com/en-us/download/details.aspx?id=5582

I believe that the manifest issue can be solved by compiling the latest
MinGW Runtime with a series of patches which will include the manifest.

Some information about patching and compiling the latest MinGW runtime can
be found here along with more information about these issues:
http://developer.berlios.de/devlog/akruis/2012/06/10/msvcr90dll-and-mingw/

All this will move us towards a toolchain that should be able to use the
pre-compiled python and wxpython distributions for Windows.

Dependancy Walker shows this mod to be working correctly. If you get an
error with a test program saying that the C runtime library has been
started incorrectly it's likely there's a problem with the manifest file.

Lastly, apparently GPL V3 has removed the problem with distributing the
msvcr90.dll (or whatever version).

Best Regards, Brian.

Attachment: specs90
Description: Binary data

Attachment: test90.exe.manifest
Description: Binary data


Follow ups