Open Apriltanq opened 2 years ago
The project failed from commit b7e97ceeecb3fa7b615041f439ec96a100f19fcc, I saw the CMakeList.txt has been changed, and this change caused the project fail.
Hi all, I also encountered the same mistake in 6159792. Could you help look?
We have also faced this issue on VS2022. Could you please help us in investigating it?
The DLL copy command is placed inside the foreach shader
loop, resulting in multiple attempts to copy the same DLL files simultaneously, which leads to conflicts and may cause this build error.
Use cmake -E copy_if_different
instead of cmake -E copy
resolves the MSB3073 build error in my environment:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -252,7 +252,7 @@ function(create_project_from_sources chapter demo)
if(WIN32)
# configure_file(${SHADER} "test")
add_custom_command(TARGET ${NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SHADER} $<TARGET_FILE_DIR:${NAME}>)
- add_custom_command(TARGET ${NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${DLLS} $<TARGET_FILE_DIR:${NAME}>)
+ add_custom_command(TARGET ${NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DLLS} $<TARGET_FILE_DIR:${NAME}>)
elseif(UNIX AND NOT APPLE)
file(COPY ${SHADER} DESTINATION ${CMAKE_SOURCE_DIR}/bin/${chapter})
elseif(APPLE)
@JoeyDeVries This seems like a minor error, would you consider fixing it in the master branch?
@hongjiang-ye that sounds like a good fix actually. Yes, feel free to set up a PR and I'll aprove. Thank you!
LearnOpenGL failed to build with error MSB3073. It can reproduce on version 514e43052ba6625b58315dbd0e1bf172a9039a94. Could you please help look at this issue? Thank you very much. Environment Compiler version: VS2019 Operating system: Windows server 2019 Reproduce steps:
Error log: build.log
Error info: MSB3073: setlocal [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr__2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -E copy F:/gitP/JoeyDeVries/LearnOpenGL/src/6.pbr/2.2.1.ibl_specular/2.2.1.prefilter.fs F:/gitP/JoeyDeVries/LearnOpenGL/bin/6.pbr/Release [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmEnd [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmErrorLevel [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: exit /b %1 [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmDone [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: setlocal [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -E copy F:/gitP/JoeyDeVries/LearnOpenGL/dlls/assimp-vc140-mt.dll F:/gitP/JoeyDeVries/LearnOpenGL/dlls/ikpMP3.dll F:/gitP/JoeyDeVries/LearnOpenGL/dlls/irrKlang.dll F:/gitP/JoeyDeVries/LearnOpenGL/bin/6.pbr/Release [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmEnd [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmErrorLevel [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: exit /b %1 [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmDone [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :VCEnd" exited with code 1. [F:\gitP\JoeyDeVries\LearnOpenGL\build_amd64\6.pbr2.2.1.ibl_specular.vcxproj]