Closed LyffLyff closed 2 years ago
Can you paste the whole build output? CMake/Visual studio integration sucks so the error is actually before this.
However, my guess... the install task copies the built dll into the example directory. Maybe you're building with Godot and the dll loaded so Windows has locked the file and won't let you overwrite it.
Yeah, you were dead right, the reason for this Error was that godot was running in the background. It doesn't matter if it crashed because of an error or someting. Running apps in godot must be properly closed with F8 so it works. There has been one instance were the error occured even though everything was closed, but this happend once and resolved itself very quickly.
I know we have probably a found the issue, but heres the whole build output since you asked:
Rebuild started... 1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------ 1>Checking Build System 2>------ Rebuild All started: Project: gdnative-example, Configuration: Debug x64 ------ 2>Building Custom Rule C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/CMakeLists.txt 2>Godot.cpp 2>C:\Users\hinte\GodotProjects\MusicPlayer\godot-native-example\src\Godot.cpp(78,24): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 2> Creating library C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/work/Debug/gdnative-example.lib and object C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/work/Debug/gdnative-example.exp 2>gdnative-example.vcxproj -> C:\Users\hinte\GodotProjects\MusicPlayer\godot-native-example\work\Debug\gdnative-example.dll 2>Done building project "gdnative-example.vcxproj". 3>------ Rebuild All started: Project: ALL_BUILD, Configuration: Debug x64 ------ 3>Building Custom Rule C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/CMakeLists.txt 4>------ Rebuild All started: Project: INSTALL, Configuration: Debug x64 ------ 4>-- Install configuration: "Debug" 4>-- Installing: C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/work/../app/addons/example/./gdnative-example.lib 4>-- Installing: C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/work/../app/addons/example/./gdnative-example.dll 4>CMake Error at cmake_install.cmake:49 (file): 4> file INSTALL cannot copy file 4> "C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/work/Debug/gdnative-example.dll" 4> to 4> "C:/Users/hinte/GodotProjects/MusicPlayer/godot-native-example/work/../app/addons/example/./gdnative-example.dll": 4> Permission denied. 4> 4> 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: The command "setlocal 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmEnd 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmErrorLevel 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: exit /b %1 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmDone 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd 4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :VCEnd" exited with code 1. 4>Done building project "INSTALL.vcxproj" -- FAILED. ========== Rebuild All: 3 succeeded, 1 failed, 0 skipped ==========
After folllowing the GDNative Tutorial using Visual Studio 2022 on Windows 10 , everything worked well. But adding or just changing parts of code an Error appears saying "The command setlocal". It appears when building the INSTALL, after building ALLBUILD with no errors of course.
This Error can be temporarly fixed for me by restarting my entire PC, only restarting Visual Studio doesn't work.
Full Error: Severity Code Description Project File Line Suppression State Error MSB3073 The command "setlocal "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake 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" exited with code 1. INSTALL C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 157
EDIT: Also, it doesn't appear frequently sometimes I comes every 5 minutes and sometimes it doesn't appear at all.