<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 27, 2015 at 2:45 AM, Michael Spencer <span dir="ltr"><<a href="mailto:bigcheesegs@gmail.com" target="_blank">bigcheesegs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Jan 27, 2015 at 10:02 AM, Mueller-Roemer, Johannes Sebastian<br>
<<a href="mailto:Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de">Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de</a>> wrote:<br>
> Adding -D__MSVCRT_VERSION__=0x900 (or higher) to CMAKE_CXX_FLAGS and<br>
> -lmsvcr90 (or higher) to CMAKE_CXX_STANDARD_LIBRARIES appears to work.<br>
> -lmsvcrt80 does not work, contrary to the comment on the MinGW bug tracker.<br>
> However, if you do not have the runtimes installed, errors will occur later<br>
> on in the build process, such as:<br>
><br>
> [215/1199] Building Intrinsics.gen...<br>
><br>
> FAILED: cmd.exe /c cd D:\Slave\llvm-mingw\buildMinGW\include\llvm\IR &&<br>
> D:\Slave\llvm-mingw\buildMinGW\bin\llvm-tblgen.exe -gen-intrinsic -I<br>
> D:/Slave/llvm-mingw/build/include/llvm/IR -I<br>
> D:/Slave/llvm-mingw/build/lib/Target -I D:/Slave/llvm-mingw/build/include<br>
> D:/Slave/llvm-mingw/build/include/llvm/IR/Intrinsics.td -o<br>
> D:/Slave/llvm-mingw/buildMinGW/include/llvm/IR/Intrinsics.gen.tmp<br>
><br>
><br>
><br>
> As I do not have administrative privileges on the machine, I switched to<br>
> MSVCRT100, as those runtimes were already installed. Which leads me to the<br>
> question: Should the exact MSVCRT version be selectable or should the lowest<br>
> version necessary (9.0) be used?<br>
><br>
<br>
</span>Is there any way for CMake to detect which version of MSVCRT is<br>
present? Otherwise there's really no default we can give. If not, then<br>
we'll have to disable the error UI suppression on mingw.<br></blockquote><div><br></div><div>On MinGW, we could use GetProcAddress and GetModuleHandle(dllname) for all dll names in { "msvcrt120", "msvcrt110", ... }, as horrible as that is. </div></div></div></div>