LNK 2001 error caused by virtual interface
I've been trying to implement a simple interface into my project Damageable. It contains a single virtual method Damage(float damage). Everything appears to be fine with intellisense, however when the project is compiled in the editor it throws the following error
my code for my interface is as follows
It seems like such a simple task to create a pure virtual function within an interface, but I cannot figure out how to implement it. I think it has something to do with the function being virtual, however I don't know where to go from here. Why is this error being thrown and what can I do to fix it?
asked Jan 10 '19 at 12:45 AM in C++ Programming
Based on the log output, it looks like it's your AReflectionsCharacter class that's throwing the error.
The "unresolved external symbol" error often appears when you declare a function in your class header file, but don't define it in any source (.cpp) files.
In your case, my guess is, you've set your AReflectionsCharacter class to inherit from your new interface, but haven't yet defined and declared an override for the interface's Damage(...) function.
Have a look at that and let me know if that's what's going on.
answered Jan 10 '19 at 04:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here