UE4 4.9 Xcode Error On Access of UFUNCTION()

Okay.

M Following the FPS C++ programming tutorial from the wiki.
Now, I m following the FPS Character and trying to setup Input.

After setting up, when i build the project, i get the following error.


ExternalBuildToolExecution FPSProject\ -\ Mac
    cd /Users/Shared/UnrealEngine/4.9
    export ACTION=
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Users/Shared/UnrealEngine/4.9/Engine/Build/BatchFiles/Mac/RocketBuild.sh FPSProject iphoneos DebugGame /Volumes/Storage/Unreal\ Projects/FPSProject/FPSProject.uproject

Setting up Mono
Building FPSProject...
Compiling with iPhoneOS SDK 8.1
Parsing headers for FPSProject
  Running UnrealHeaderTool "/Volumes/Storage/Unreal Projects/FPSProject/FPSProject.uproject" "/Volumes/Storage/Unreal Projects/FPSProject/Intermediate/Build/IOS/FPSProject/DebugGame/UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -rocket -installed
Reflection code generated for FPSProject in 5.6724278 seconds
Compiling with these architectures: armv7
Performing 4 actions (8 in parallel)
[1/4] clang++ FPSProject.generated.cpp
[3/4] clang++ FPSCharacter.cpp
[2/4] clang++ FPSGameMode.cpp
[4/4] clang++ /Volumes/Storage/Unreal Projects/FPSProject/Binaries/IOS/FPSProject-IOS-DebugGame
Undefined symbols for architecture armv7:
  "AFPSCharacter::MoveForward(float)", referenced from:
      AFPSCharacter::execMoveForward(FFrame&, void*) in FPSProject.generated.cpp.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: /Volumes/Storage/Unreal Projects/FPSProject/Binaries/IOS/FPSProject-IOS-DebugGame
Total build time: 23.67 seconds
**Command /Users/Shared/UnrealEngine/4.9/Engine/Build/BatchFiles/Mac/RocketBuild.sh failed with exit code 5**

Now, from the FPSCharacter file, when i remove the UFUNCTION() declaration, i stop getting the error and build succeeds.
M working in Xcode 6.1.1 and am unable to figure out, as if to, how to resolve this error.
Can someone pool in with any suggestions??

– bump –

I updated Xcode to the latest one and i still get this error.
Can anyone help me on this??

Hello kinzua01,

Could you post the .h for the class this error is occurring in? It is difficult to debug code without having context as it could be the surrounding code that is causing the issue.

hi ,

thanks for reverting back.
Here is the .h file.


#pragma once

#include "GameFramework/Character.h"
#include "FPSCharacter.generated.h"

UCLASS()
class FPSPROJECT_API AFPSCharacter : public ACharacter
{
	GENERATED_BODY()

public:
	// Sets default values for this character's properties
	AFPSCharacter();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
    

    UFUNCTION()
    void MoveForward(float val);

//    //handles strafing
//    UFUNCTION()
//    void MoveRight(float val);
	
};

Do you actually have a void AFPSCharacter::MoveRight(float val) in your cpp file? If not, that’ll be your problem.

I’ve commented it out :slight_smile:

EDIT::

This makes up for one of the most embarrassing moments of my life.
I hadn’t done an implementation in the cpp file. This is actually very foolish of me.

Just included blank implementations and built all fine.
Apologies for bothering everyone out here. My most horrible programming bad.