Access violation - code c0000005 (first/second chance not available)
I have followed these video tutorials (https://www.youtube.com/watch?v=vtcWrcscXos∈dex=1&list=PLZlv_N0_O1gb5xvsc7VM7pfoRAKLuIcFi), for getting started with coding in C++ for UE4.
The following dialog box with this message shows up when I use the DebugGame Editor solution configuration, in VS2013:
Default Property warnings and errors:![alt text] Error: CDO Constructor: Failed to find Engine/Content/Slate/Fonts/RobotoDistanceField
The editor still loads up the project though, I am even allowed to build the level of such, but when I hit play or simulate, VS2013 throws up an Unhandled exception as informed to me by VS2013 here:
Unhandled exception at 0x000007FEDC1DE90D (UE4Editor-CodedThirdPersonTest-Win64-DebugGame.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000000000000440
If I load up the project from the launcher, I do not get the dialog box, that says that it failed to find the font I am using, I can even build the project without crashes as well, but when I hit play or simulate, the editor crashes and gives a crash report dialog box, with the following message in the CallStack:
This project was created with version 4.4.3, and version 4.4.3 is used to load the project from the launcher.
I have also loaded other projects of mine and none of them get this crash error.
Edit: As of today, the 19/10/2014, I have also created a new third person code project, built it, and that runs just fine, no errors, no crashes, which could very well mean that there could be a fault with my code, or VS2013, a link to a zip of the source is here: https://dl.dropboxusercontent.com/u/109608967/Source.zip
I was not getting this crash before adding text to the HUD, the base HUD class did not cause any crashes or compilation errors, but trying to draw text to the HUD canvas, did cause the popup, that occurs when I ran the DebugGame Editor solution configuration (failed to find), then trying to run or simulate the default level, with this gamemode, causes the crash as detailed above.
Edit as of 20/10/2014: I have managed to narrow down the error to this if statement, not the code within the if statement, but the line
I have even changed the Enum, from being part of a namespace, to being a UENUM, of the ACodedThirdPersonTestGameMode class declaration, in the header file of ACodedThirdPersonTestGameMode, as shown below:
Edit as of 3 hours after the first edit on 20/10/2014:
I have changed my enum to be assigned a value on declaration as so:
I have also edited the
Doing both of these changes, still cause the access violation error to occur once again.
Edit as of 21/10/2014: I have tried to get the value on the enum,so that I can see it in debug mode, by making the variable public, this is what is shown now:
Even though I assign a value to the
I spent some time today going through the tutorial to the point where you ran into problems, and was unable to reproduce the problem. So I took a closer look at your source code, and I think I might have spotted where things are going wrong. In your CodedThirdPersonTestHUD.cpp file, line 34, you have:
Instead, try using this line:
It looks like it may have been a copy-paste error from line 28. The second line is how I have it in my project and it works. I have not tried making that change in the code you provided yet, but if you try it and it doesn't help, let me know and I will do some more testing in the morning.
answered Oct 21 '14 at 10:48 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here