Unresolved external symbol since update to 4.02

Yesterday, while working through the FPS Tutorial, my code compiled and ran without error. Last night, I updated my engine source code to 4.02, following the instructions given by Mike Fricker (Update 4.0.2 is live! - Announcements - Unreal Engine Forums). I rebuild the UE4 solution and then decided to rebuild my own code from the tutorial and received the following error (it’s reported twice in the output and I’ve included both).

error LNK2019: unresolved external symbol “public: void __cdecl AFPSCharacter::OnFire(void)” (?OnFire@AFPSCharacter@@QEAAXXZ) referenced in function “protected: virtual void __cdecl AFPSCharacter::SetupPlayerInputComponent(class UInputComponent *)” (?SetupPlayerInputComponent@AFPSCharacter@@MEAAXPEAVUInputComponent@@@Z)

error LNK2001: unresolved external symbol “public: void __cdecl AFPSCharacter::OnFire(void)” (?OnFire@AFPSCharacter@@QEAAXXZ)

I did not make any changes to my code, so I’m not sure why VS 2013 can no longer find the OnFire method. Does anyone have any idea why this is happening? It would help save the few hair that I have left :frowning:

Thanks.

get something like WindowsGrep and search the code base for OnFire

and see if it is still there!

Rama

Hi Rama,

The OnFire() method is not overridden from a base class, it is declared in FPSCharacter.h (from the tutorial). Thanks for the suggestion (and I do use wingrep now, because you recommended it in response to another post about uncodex). In fact, the only reason that I downloaded the source is to be able to search it like you suggest. I’m beginning to think, however, that it was a bad idea.

“it is declared in FPSCharacter.h”

wow that’s really strange then!

can you post all the related coded in main post (better coloring there)

Hi! The compile error suggests that the .cpp file for AFPSCharacter is being built, as it’s telling you that ADPSCharacter::SetupPlayerInputComponent is referencing ::OnFire (unless that function is defined in the header).

Therefore the only way I could think this error could be emitted is if AFPSCharacter::OnFire hasn’t actually been defined anywhere. Could you double check that the function definition exists please?

Thanks for the reply, Andrew. Yes, I checked and the method is there.

Thank you Rama and Andrew for trying to help. What I gathered from your responses is there is no logical reason for this behaviour. Therefore, believing that my local copy had become “forked” (as in forked up), I deleted my local repo and my forked copy on GitHub and started fresh from the 4.02 build (i.e. fork and clone). The tutorial code compiles again like it should. I can hardly wait for the 4.1 update :frowning:

On the up side, I still have some hair left, thanks to your responses :slight_smile:

It’s a mystery! The next step would have been to clean your intermediate folder and regenerate projects, but I’m glad you got it sorted, retaining some hair :slight_smile:

Tu editor esta cerrado?

Thanks for the follow-on tip, Andrew. I’ll keep it in mind if I have other issues. Programming issues … I meant programming issues.