Visual Studio 2012 build hangs - c++

As recently as the last few days, a project I'm working on in MSVS2012 has begun hanging on build. I've taken steps trying to log what VS is doing as in the following link : How to Troubleshoot Visual Studio 2012 Hangs/Lockups but have not been able to find any "errors" or anything that "fails" to load. The build will finish, but it now takes several minutes as opposed to a few seconds. Anytime I attempt to cancel the build, I get a generic message about how the system is waiting on "GenerateDeps" to finish.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 6.0.targets(402,9): warning MSB4220: Waiting for the currently executing task "GenerateDeps" to cancel.
EDIT
Here's some additional verbose/diagnostic output. This seems to be where VS is lagging...
Input file "GPU RKF45 (Variable Step Size).cu" is newer than output file "x64\Debug\GPU RKF45 (Variable Step Size).cu.deps".
1>Using "GenerateDeps" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\Nvda.Build.CudaTasks.v6.0.dll".
1>Task "GenerateDeps" (TaskId:23)
1> Task Parameter:
1> AdditionalIncludeDirs=
1> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include
1> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin
1> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include
1> . (TaskId:23)
1> Task Parameter:ForcedIncludeFiles=cuda_runtime.h (TaskId:23)
1> Task Parameter:
1> PreprocessorDefinitions=
1> __CUDACC__
1> _MBCS (TaskId:23)
1> Task Parameter:SourceFile=C:\Users\Karsten Chu\New Google Drive\Research\Visual Studio 2012\Projects\Dynamic Parallelism Test\Dynamic Parallelism Test\GPU RKF45 (Variable Step Size).cu (TaskId:23)
1> Command: (TaskId:23)
1> The "GenerateDeps" task is using "cl.exe" from "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\cl.exe". (TaskId:23)

I have had problems with hanging builds in VS some long time ago and I traced back the root cause to be always resource related. Such as a slow processor (yes, it matters when you compile!), or not enough memory. The only solution that worked for me was always a full rebuild (clean) and leave the computer alone while it builds. This might or might not help you, if you share more information someone might have a deeper insight.

I have frequently been able to recover Visual Studio 2012 from hanging when a build fails with the message "Waiting for the currently executing task "CL" to cancel." by ending all of the "cl" processes. For example, open up the Windows task manager and find all the processes named "cl.exe" (which is the MSVC compiler) and end process on them. Visual Studio resumes operation shortly thereafter.
If there are additional/custom build tasks, there may be other processes running. For example, if a custom build event launches an executable, that executable process may need to be killed as well.

I found vc12 build will appear to hang if you make an error in project properties such that an output folder is invalid.
eg want to set OutputDirectory to something but due a typo when editing the property it resolves to an invalid path.
Instead of giving an invalid path error the build appears to hang.
I say appears to hang because what actually happens is does nothing for a long time during which you cannot cancel the build of exit DevStudio.
Eventually (several minutes) it gives an error but that time is so long it looks like a hang.

I had to replace cl.exe /E option to /P within Nvda.Build.CudaTasks.vX.Y.dll files to evade the problem. There wasn't the problem few days ago so I'm not sure at all why the problem has surfaced.

Related

Unreal is taking over 30 mins to compile code

So I have a decent understanding of c++ and have been following a course on udemy to better understand unreal itself. I've had it installed about a week working great but it recently decided to take for ever to compile. Normally it takes like a minute at most and rarely that but now its taking up to a like 30 mins. I deleted and made it remake the binary's same issue. I've tried googling it i can't seem to find anything to help. This is the message output.
Total execution time: 1489.19 seconds
Building BullCowGameEditor...
Using Visual Studio 2019 14.25.28612 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
[Upgrade]
[Upgrade] Using backward-compatible build settings. The latest version of UE4 sets the following values by default, which may require code changes:
[Upgrade] bLegacyPublicIncludePaths = false => Omits subfolders from public include paths to reduce compiler command line length. (Previously: true).
[Upgrade] ShadowVariableWarningLevel = WarningLevel.Error => Treats shadowed variable warnings as errors. (Previously: WarningLevel.Warning).
[Upgrade] PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs => Set in build.cs files to enables IWYU-style PCH model. See https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/IWYU/index.html. (Previously: PCHUsageMode.UseSharedPCHs).
[Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V2;' in BullCowGameEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
[Upgrade]
Building 4 actions with 24 processes...
[1/4] BullCowCartridge.cpp
Creating library C:\Users\Jacob Krumholz\Desktop\Unreal\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-3564.suppressed.lib and object C:\Users\Jacob Krumholz\Desktop\Unreal\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-3564.suppressed.exp
[2/4] UE4Editor-BullCowGame-3564.lib
Creating library C:\Users\Jacob Krumholz\Desktop\Unreal\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-3564.lib and object C:\Users\Jacob Krumholz\Desktop\Unreal\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-3564.exp
[3/4] UE4Editor-BullCowGame-3564.dll
[4/4] BullCowGameEditor.target
Total time in Parallel executor: 1488.05 seconds
I've restarted VS, UE4, and windows just in case that was the issue. I could reinstall it if the issue won't go away but that would be a pain. I'm on windows 10 and UE4.24.3.

Error compiling Unreal Engine 4.24.1 after updating visual studio 2019

I'm having a weird error after updating Visual Studio 2019 Community from v16.4.5 to 16.5. Even a fresh install of the engine will no longer build. I'm getting the errors listed below. The build doesn't fail until the end of compiling all modules:
Error C4800 Implicit conversion from 'ADODB::_Recordset *const ' to bool. Possible information loss UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h 311
Error C4800 Implicit conversion from 'ADODB::_Connection *const ' to bool. Possible information loss UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h 311
Error MSB3075 The command "..\..\Build\BatchFiles\Build.bat -Target="UE4Editor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command. UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 44
I have not changed or updated anything on the Unreal Engine-side of the code. This error occurs during a build of UE4.sln, sourced from Epic's github repo. The build doesn't fail until all modules are built (it fails at the end of the build).
Seeing as Microsoft doesn't have archives of installers for VS Community, only Enterprise and Pro, I'm kind of suddenly stuck here because I can't just uninstall 16.5 and reinstall 16.4.5 (which is the last working version I was on before the update).
I heard sometimes setting "treat warnings as errors" to false can help, but I don't see a way to do that in Visual Studio.
Any insight into this would be helpful, Thanks!
So, turns out something changed on VS2019's side in the update from 16.4.5 to 16.5, but the fix for UE4 can be found in this commit on the 4.25 branch. Confirmed that this solved my problem!
First Make a backup of your whole project (just copy it to somewhere else).
Afterwards delete the following folders in the project directory:-
.vs
Intermediate
Saved
you just need to delete the .vs folder to solve the problem. The rest are just for a quick refresh of your project.
Next open Unreal Engine 4, then under File tab click on Refresh Visual Studio Project. On completion try to compile again. This should solve your problem.
For those who facing the same problem, here is the solution.
Step 1:
open the file ADOSupport.cpp on [YourEngineSourceDir]\Engine\Plugins\Runtime\Database\ADOSupport\Source\ADOSupport\Private
Step 2:
go to line 255 and modify it
from if(ADORecordSet && (ADORecordSet->State & ADODB::adStateOpen))
to if(ADORecordSet != nullptr && (ADORecordSet->State & ADODB::adStateOpen))
Step 3:
got to line 328 and modify it from if( DataBaseConnection && (DataBaseConnection->State & ADODB::adStateOpen)) to if( DataBaseConnection != nullptr && (DataBaseConnection->State & ADODB::adStateOpen))
Step 4: Build the solution and enjoy!
You should add the new line of code, like on the video tutorial:
Arguments.Add("/wd4800"); // 4800: Implicit conversion from 'type' to bool. Possible information
https://youtu.be/KXIv4y51fyw
That fix me that issue.
I had the same issue, and this solved it:
File Path
YOURENGINEPASS\Engine\Source\Programs\UnrealBuildTool\Platform\Windows
File to change
VCToolChain.cs
After line 456 add the following line:
Arguments.Add("/wd4800"); // 4800: Implicit conversion from 'type' to bool. Possible information

Permission error every time I build in visual studio 2015

I have just started learning to program using Unreal and I am following a tutorial for Unreal Engine on Udemy and recently I've been running into a problem where every time I write code wrong and I build the project , even though there are no lines indicating errors , I get this message
>
1>------ Build started: Project: BuildingEscape, Configuration: Development_Editor x64 ------
1> Compiling game modules for hot reload
1> Performing 2 actions (2 in parallel)
1> [2/2] Link UE4Editor-BuildingEscape-2523.lib
1> [1/2] Link UE4Editor-BuildingEscape-7173.dll
1> Creating library D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.lib and object D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.exp
1> Creating library D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.suppressed.lib and object D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.suppressed.exp
1>ERROR : UBT error : Failed to produce item: D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-2523.lib
1> Total build time: 3.07 seconds (Local executor: 0.00 seconds)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ""D:\Unreal Engine\Engine\UE_4.15\Engine\Build\BatchFiles\Build.bat" BuildingEscapeEditor Win64 Development "D:\Unreal Projects\03_BuildingEscape\BuildingEscape\BuildingEscape.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
and even though I delete the code that I wrote and hit build again I get the same error...
I am using windows 10.
Before you go too far down the rabbit hole, check to be sure your operating system doesn't simply have a lock on one of your intermediate files. If you delete the entire contents of D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\ before rebuilding, that will ensure that you're not simply looking at a locked or corrupt intermediate. This isn't guaranteed to be the issue, but bad intermediates can cause otherwise inexplicable build errors, so clearing them can at least narrow down the range of possible causes you'll need to investigate. Of course make sure your editor isn't running, or running as a stuck process, while you're trying to rebuild.
I don't know what is causing the issue with compiling from visual studio , but if I compile using the Compile button in Unreal the code seems to be compiling just fine.

I cannot debut a project in Code Blocks step by step

I'm trying to debut my code step by step, but I don't know why it doesn't work.
The breakpoint is set but it seems to ignore it (doesn't appear the yellow arrow).
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\CodeBlocks\ArvoresBinarias2908\
Adding source dir: C:\CodeBlocks\ArvoresBinarias2908\
Adding file: C:\CodeBlocks\ArvoresBinarias2908\bin\Debug\ArvoresBinarias2908.exe
Changing directory to: C:/CodeBlocks/ArvoresBinarias2908/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn;C:\Program Files (x86)\Skype\Phone;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Interactive Intelligence\ININ Trace Initialization;C:\Program Files (x86)\Interactive Intelligence\ICUserApps;C:\Program Files\Interactive Intelligence\ICUserApps
Starting debugger: C:\Program Files (x86)\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/CodeBlocks/ArvoresBinarias2908/bin/Debug/ArvoresBinarias2908.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 11644
[Inferior 1 (process 11644) exited normally]
Debugger finished with status 0
Can someone please help me? I've already tried somethings that I found online, but no success:
Tried with another code... no success.
Moved the project to a folder with no spaces
Checked true the "Produce debugging symbols" [-g]
Disabled the "Enable all common compiler warning..."
I really don't understand that much about Debuggers, Compilers... I just want to debug thsi code to see the variable changes and other stuff.
Thanks!
ps. This is my first question here, so sorry if I didn't follow all the rules and standards that everybody here is used to.

Visual C++ build error: Failed to register output

So I have this project I'm working on, and every time I build, it builds then executes the program, and then finishes with a build error. Why does this happen? I can't seem to find in the project properties where it would execute the file on the build.
It is kind of annoying, and it also ends up spawning an error. Here's an excerpt from the output
2>Link:
2> Generating code
2>c:\users\d0c\desktop\jlrria.lottery.repo\trunc\hash\hl_hashwrapper.h(277): warning C4706: assignment within conditional expression
2> Finished generating code
2> lottery-gui.vcxproj -> C:\Users\d0c\Desktop\jlrria.Lottery.repo\trunc\build\Release\lotteryslayer.exe
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(741,5): warning MSB3073: The command ""C:\Users\d0c\Desktop\jlrria.Lottery.repo\trunc\build\Release\lotteryslayer.exe" /RegServerRedirect" exited with code 2.
2> The previous error was converted to a warning because the task was called with ContinueOnError=true.
2> Build continuing because "ContinueOnError" on the task "Exec" is set to "true".<br>
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
2>
2>Build FAILED.
So I guess I'm looking for help with two things
First and most importantly: Why is it executing the build program
Second: Why am I getting this error?
thanks.
ALSO
There are no items in the post build, otherwise, the log above would say "post-build" :p
Start with Visual Studio with Administrator rights. You can do so by right clicking on VS shortcut and Select Run As Administrator. Or create a shortcut where you would enable Run As Admin.
Reason:
Look at the error:
error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
Also, it seems to be a DLL/ActiveX control project. Look at: Linker->General->Register Output and set it to NO.
You are building an ATL project? Seems to be a bug in VS2010, http://social.msdn.microsoft.com/Forums/en/vcprerelease/thread/11f01ceb-52a4-438f-b7ef-727ce7a3e191 concerning ATL projects.