I am seeing this failure with release and relwithdebinfo config. There are no compilation failures for debug configuration.
PreLinkEvent:
Auto build dll exports
setlocal
cd C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win
if %errorlevel% neq 0 goto :cmEnd
if %errorlevel% neq 0 goto :cmEnd
C:\cmake-3.17.0-win64-x64\bin\cmake.exe -E __create_def C:/myfolder/examples/windows/calculator/windows_Release_aarch64.cmake.win/calculator.dir/Release/exports.def C:/myfolder/examples/windows/calculator/windows_Release_aarch64.cmake.win/calculator.dir/Release//objects.txt
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: The command "setlocal [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: cd C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: C: [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: C:\cmake-3.17.0-win64-x64\bin\cmake.exe -E __create_def C:/myfolder/examples/windows/calculator/windows_Release_aarch64.cmake.win/calculator.dir/Release/exports.def C:/myfolder/examples/windows/calculator/windows_Release_aarch64.cmake.win/calculator.dir/Release//objects.txt [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :cmEnd [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :cmErrorLevel [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: exit /b %1 [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :cmDone [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(148,5): error MSB3073: :VCEnd" exited with code -1073741819. [C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj]
Done Building Project "C:\myfolder\examples\windows\calculator\windows_Release_aarch64.cmake.win\calculator.vcxproj" (default targets) -- FAILED.
I compared the PreLinkEvent lines in Debug and Release and they are exactly same except for the folder name. Any leads are appreciated.
Hi @AnnaXiu-MSFT , I am running the following command in cmdline:
C:\cmake-3.17.0-win64-x64\bin\cmake.exe --build C:\myfolder\examples\windows\calculator/windows_ReleaseG_aarch64.cmake.win --target calculator --config RelWithDebInfo
The logs pasted above are the error logs from this command. I can share the complete logs also if that is helpful. I also found that the issue is seen only when linking for DLLs and not for static libraries or executables.
Is there a way to make sense out of the error code "-1073741819" returned above?