Skip to content

MSBuild C++ ... LNK1318: Unexpected PDB error; RPC (23) '(0x000006E7)' #829

@drywolf

Description

@drywolf

Expected behavior

Run MSBuild to compile a VC++ project file in windowsservercore

Actual behavior

LNK1318: Unexpected PDB error; RPC (23) '(0x000006E7)'

Information

I am trying to build some C++ programs in windows containers, therefore I'm using the latest windowsservercore image as a base and then I install the VC++ 2015 Build tools from here.

The Dockerfile looks something like this:

FROM microsoft/windowsservercore:latest

# install MSBuild & C++ build tools
RUN Invoke-WebRequest "http://go.microsoft.com/fwlink/?LinkId=691126" \
    -OutFile visualcppbuildtools_full.exe -UseBasicParsing ; \
    Start-Process -FilePath 'visualcppbuildtools_full.exe' -ArgumentList '/quiet', '/NoRestart' -Wait ; \
    Remove-Item .\visualcppbuildtools_full.exe

# MSbuild path
RUN $env:PATH = 'C:\Program Files (x86)\MSBuild\14.0\Bin;'+$env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);

When I then try and run MSBuild on a VC++ .sln file...
(I reproduced this with just an empty Win32 Console App template)

msbuild VCppTestApp.sln /t:Rebuild /property:Configuration=Release

then I get the following error:

Microsoft Windows [Version 10.0.14393]
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 6/11/2017 6:56:42 PM.
Project "C:\j2v8\VCppTestApp\VCppTestApp.sln" on node 1 (Rebuild target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".
Project "C:\j2v8\VCppTestApp\VCppTestApp.sln" (1) is building "C:\j2v8\VCppTestApp\VCppTestApp\VCppTestApp.vcxproj" (2) on node 1 (Rebuild target(s)).
CoreClean:
  Creating directory "x64\Release\".
PrepareForBuild:
  Creating directory "C:\j2v8\VCppTestApp\x64\Release\".
  Creating directory "x64\Release\VCppTestApp.tlog\".
InitializeBuildStatus:
  Creating "x64\Release\VCppTestApp.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /Zi /nologo /W3 /WX- /sdl /O2 /Oi /GL /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Yc"stdafx.h" /Fp"x64\Release\VCppTestApp.pch" /Fo"x64\Release\\" /Fd"x64\Release\vc140.pdb" /Gd /TP /errorReport:queue stdafx.cpp
  stdafx.cpp
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /Zi /nologo /W3 /WX- /sdl /O2 /Oi /GL /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Yu"stdafx.h" /Fp"x64\Release\VCppTestApp.pch" /Fo"x64\Release\\" /Fd"x64\Release\vc140.pdb" /Gd /TP /errorReport:queue VCppTestApp.cpp
  VCppTestApp.cpp
Link:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\j2v8\VCppTestApp\x64\Release\VCppTestApp.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\j2v8\VCppTestApp\x64\Release\VCppTestApp.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:incremental /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\j2v8\VCppTestApp\x64\Release\VCppTestApp.lib" /MACHINE:X64 x64\Release\stdafx.obj
  x64\Release\VCppTestApp.obj
  Generating code
  All 5 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) '(0x000006E7)' [C:\j2v8\VCppTestApp\VCppTestApp\VCppTestApp.vcxproj]
Done Building Project "C:\j2v8\VCppTestApp\VCppTestApp\VCppTestApp.vcxproj" (Rebuild target(s)) -- FAILED.
Done Building Project "C:\j2v8\VCppTestApp\VCppTestApp.sln" (Rebuild target(s)) -- FAILED.

Build FAILED.

"C:\j2v8\VCppTestApp\VCppTestApp.sln" (Rebuild target) (1) ->
"C:\j2v8\VCppTestApp\VCppTestApp\VCppTestApp.vcxproj" (Rebuild target) (2) ->
(Link target) ->
  LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) '(0x000006E7)' [C:\j2v8\VCppTestApp\VCppTestApp\VCppTestApp.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:09.17

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions