Docker Community Forums

Share and learn in the Docker community.

Windows container fails to build VS 2013 C++ project

dockerhub

(Katariaashish) #1

I should be able to build a C++ project on a windows docker container using MSBuild.exe

C++ Project fails to build with error:

Midl:
C:\Program Files (x86)\Windows Kits\8.1\bin\x86\midl.exe /W1 /nologo /char signed /env x64 /h “Enumglob.h” /tlb “x64\ReleaseMinDependency\AnalyticsNativeCore.tlb” Enumglob.idl
64 bit Processing .\Enumglob.idl
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(1178,5): error MSB6006: “midl.exe” exited with code -2147024774.


Build FAILED.

Information

This is my Dockerfile which already has the Visual C++ Redistributables installed. I’m not sure what else is missing and the error message is not helpful.

FROM chemsorly/msbuilder:1.0.0-vsc
SHELL [“powershell”]

Download VC++ 2010 SP1 Redistributable Package (x64)

Removed the link as I’m only allowed to post 2 links in this topic

Download VC++ 2012 Update 4 Redistributable Package (x64)

RUN Invoke-WebRequest http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe -OutFile “$env:TEMP\vc2012x64.exe” -UseBasicParsing
RUN Start-Process “$env:TEMP\vc2012x64.exe” ‘/features + /q’ -wait
RUN Remove-Item “$env:TEMP\vc2012x64.exe”

Download VC++ 2013 Redistributable Package (x64)

RUN Invoke-WebRequest http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe -OutFile “$env:TEMP\vc2013x64.exe” -UseBasicParsing
RUN Start-Process “$env:TEMP\vc2013x64.exe” ‘/features + /q’ -wait
RUN Remove-Item “$env:TEMP\vc2013x64.exe”

Note: Add MSBuild to path

RUN setx PATH ‘%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin’

Download VC++ 2015 Build Tools

Removed the link as I’m only allowed to post 2 links in this topic OutFile “$env:TEMP\vc++2015bt.exe” -UseBasicParsing
RUN Start-Process “$env:TEMP\vc++2015bt.exe” ‘/features + /q’ -wait


(Mwalzer) #2

Well, you can check if the vcredist dlls get installed properly, that’s what was failing for me.
reg query HKLM /s /f MSVCP120.dll