Error: waitmutex -2015 exited with code -1 “Microsoft.MakeFill.Targets” line 37.
Okay so some Unreal macro doesn’t like the code above? According to other topics on the AnswerHub this is the way to implement it. Why is UE4 throwing a compiler error in Visual Studio?
I tried adding the code to the cpp as wel (even though this should not be implemented but just to try it out):
void ABaseCharacter_C::OnDeath() { }
But same error. If I remove all of the code above then everything compiles again just fine so it’s not another piece of code. I also tried changing the name of OnDeath to something else in case it was conflicting with another name but that didn’t work either. I also tried adding “virtual” but that raised the same error.
4.8 Patch:
Removed “virtual” keyword from several engine-level BlueprintImplementableEvents to conform to the new “BlueprintImplementableEvents should not be virtual” standard.
I can suffix my C++ classes with an underscore _C if I want too (I hope). That should not cause any problems. It’s not a typo. My class is actually called: BaseCharacter_C.
yes you’re right, you don’t need the C++ Implementation.
BlueprintImplementableEvent only has a Blueprint Version.
BlueprintNativeEvent would have the C++ AND Blueprint Version.
The code looks fine, that’s how I did it too. Is this all error you get? Could you check out the OUTPUT tab, after the Compilation failed? The one you normally get is the ERROR LIST tab. When you open the OUTPUT tab, scroll up till the first error and check if that helps you (if not, quote the whole Output, starting at the first Error, here).
You should find the OUTPUT tab at the bottom of VS:
Strangely this particular error was fixed by restarting the UE4 Editor and Visual Studio (I noticed I was missing the compile button in UE4). I noticed that starting UE4 before VS can lead to weird behavior and that compiling the project in VS while opening the project in the UE4 Edtitor can also be bad. And missing the “Compile” button in UE4 can also lead to weird behavior. And sometimes when the UE4 Editor complains (spams log with those errors) about a None-class restarting the Editor fixes it.
However I still have a problem regarding the implementation (which I want to add in the blueprint actually but okay I guess I still need an empty implementation in C++ at the very least):
It compiles but the event never fires when I call it with either OnDeath() or OnDeath_Implementation(). Also no errors, not in VS, not in UE4. But nothing happens:
Clearly I’m missing something simple but the tutorials I find online all tell me to use “_Implementation” suffix. but it does not work.
All logic will be added in the Blueprint Child Class. And the function, in C++, will be called via “OnDeath();”.
ALSO: Your Code is not compiling. It’s still failing!
Remove the things i mentioned and recompile. Then check if there are still errors.
NOTE
Recompiling while the Editor is opened is called “Hot Reloading”. This is not working well if you add new declarations to the Header File. You can use it if you make smaller changes to the implementation of functions, but if you change the declaration in the header file, you need to restart the Editor. Otherwise changes could not get through.
You should also set VS to “Development Editor” and compile the Game by right-clicking your Project in the Solution Browser of VS and hitting “Build”.
For debugging C++ code, set VS to “DebugGame Editor” and hit the Player Button at the top.
“For debugging C++ code, set VS to “DebugGame Editor” and hit the Player Button at the top.”
“You can use it if you make smaller changes to the implementation of functions, but if you change the declaration in the header file, you need to restart the Editor. Otherwise changes could not get through.”
Oh. I see. That changes things. Now it does work without the implementation! I usually press F7 to build the entire solution in VS and don’t restart UE4 but it seems required sometimes.
So the solution was: No implementation, only add code to the header file and change the Visual Studio debugger to “DebugGame Editor” and restart UE4 Editor.