Build Fails on 4.7

I’ve been working on a set of gesture recognizers for mobile devices.

The code has been added to a basic FPS template app. During development, I’ve mostly been using the UDK Remote rather than testing on device, and it’s been working fine. If I go to run on device or package for iOS, however, I get errors.

The code is available in a public github repo:

The C++ code compiles without errors or warnings, and the project builds fine, but I when I try to build for device or package for device, it says that basic UE4 types like FVector and UObject are not recognized. Any thoughts or suggestions about what’s causing the build problem here would be greatly appreciated.

Directories : System.String[] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
Compiling with IOS SDK 8.2
Parsing headers for GestureRecognizer
Reflection code generated for GestureRecognizer
Compiling with these architectures: armv7,arm64
Performing 15 actions (16 in parallel)
[14/15] clang++ UELinkerFixups.cpp
[2/15] clang++ GestureRecognizerGameMode.cpp
[9/15] clang++ GestureRecognizerComponent.cpp
[5/15] clang++ GestureRecognizerCharacter.cpp
[8/15] clang++ GestureRecognizerHUD.cpp
[1/15] clang++ PinchRotateGestureRecognizer.cpp
[4/15] clang++ DynamicGestureRecognizer.cpp
[7/15] clang++ SwipeGestureRecognizer.cpp
[10/15] clang++ GestureRecognizerProjectile.cpp
[13/15] clang++ GestureRecognizer.generated.cpp
[12/15] clang++ GestureRecognizer.cpp
[3/15] clang++ PanGestureRecognizer.cpp
[11/15] clang++ GestureMathLibrary.cpp
[6/15] clang++ TapGestureRecognizer.cpp
In file included from /Users//Documents/Unreal Projects/GestureRecognizer/Intermediate/Build/IOS/GestureRecognizer/Inc/GestureRecognizer/GestureRecognizer.generated.cpp:8:
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:13:28: error: unknown type name 'FVector'
        void DetectGestures(const FVector (&Touches)[EKeys::NUM_TOUCH_KEYS], class UPlayerInput* PlayerInput, float DeltaTime);
                                  ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:13:47: error: use of undeclared identifier 'EKeys'
        void DetectGestures(const FVector (&Touches)[EKeys::NUM_TOUCH_KEYS], class UPlayerInput* PlayerInput, float DeltaTime);
                                                     ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:17:54: error: unknown type name 'FKey'
        void HandleGesture(class UPlayerInput* PlayerInput, FKey Gesture, bool bStarted, bool bEnded);
                                                            ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:20:2: error: unknown type name 'TMap'
        TMap<FKey, float> CurrentGestureValues;
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:20:6: error: expected member name or ';' after declaration specifiers
        TMap<FKey, float> CurrentGestureValues;
        ~~~~^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:23:2: error: unknown type name 'FVector2D'
        FVector2D AnchorPoints[EKeys::NUM_TOUCH_KEYS];
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:23:25: error: use of undeclared identifier 'EKeys'
        FVector2D AnchorPoints[EKeys::NUM_TOUCH_KEYS];
                               ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:27:2: error: unknown type name 'FVector2D'
        FVector2D FlickCurrent;
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Public/GestureRecognizer.h:29:2: error: unknown type name 'int32'
        int32 PreviousTouchCount;
        ^
In file included from /Users//Documents/Unreal Projects/GestureRecognizer/Intermediate/Build/IOS/GestureRecognizer/Inc/GestureRecognizer/GestureRecognizer.generated.cpp:9:
In file included from /Users//Documents/Unreal Projects/GestureRecognizer/Intermediate/Build/IOS/GestureRecognizer/Inc/GestureRecognizer/GestureRecognizer.generated.dep.h:9:
In file included from /Users//Documents/Unreal Projects/GestureRecognizer/Source/GestureRecognizer/GestureMathLibrary.h:5:
In file included from /Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/Engine/Classes/Kismet/BlueprintFunctionLibrary.h:4:
In file included from /Users/Shared/UnrealEngine/4.7/Engine/Intermediate/Build/IOS/Inc/Engine/BlueprintFunctionLibrary.generated.h:8:
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:10:9: error: unknown type name 'uint64'
typedef uint64 ScriptPointerType;
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:239:9: error: unknown type name 'uint64'
typedef uint64 EClassCastFlags;
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:420:1: error: unknown type name 'FORCEINLINE'
FORCEINLINE EObjectFlags operator|(EObjectFlags Arg1,EObjectFlags Arg2)
^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:420:25: error: expected ';' after top level declarator
FORCEINLINE EObjectFlags operator|(EObjectFlags Arg1,EObjectFlags Arg2)
                        ^
                        ;
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:460:2: error: unknown type name 'UObject'
        UObject*                                Referencer;
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:463:2: error: unknown type name 'int32'
        int32                                           TotalReferences;
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:466:2: error: unknown type name 'TArray'
        TArray<const UProperty*>                ReferencingProperties;
        ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:466:8: error: expected member name or ';' after declaration specifiers
        TArray<const UProperty*>                ReferencingProperties;
        ~~~~~~^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:468:26: error: unknown type name 'UObject'
        FReferencerInformation( UObject* inReferencer );
                                ^
/Users/Shared/UnrealEngine/4.7/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectBase.h:469:26: error: unknown type name 'UObject'
        FReferencerInformation( UObject* inReferencer, int32 InReferences, const TArray<const UProperty*>& InProperties );
                                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: /Users//Documents/Unreal Projects/GestureRecognizer/Binaries/IOS/GestureRecognizer-IOS-Shipping
Cumulative action seconds (16 processors): 0.00 building projects, 322.43 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.00 linking, 0.00 other
UBT execution time: 40.33 seconds

Did you compile the editor/game for Mac or Windows? It looks like your include paths are not set up correctly in your module or something like that, or you have some #includes inside #if statements that aren’t true for iOS. It can’t find some basic Core stuff, I can’t really think what you could have done or not done to make that happen, only for iOS.

Also, I suggest you don’t package/compile with Shipping for your initial testing, use Development (Shipping by default compiles 32 and 64 bit, which will double your compile time).

Josh

Did you compile the editor/game for Mac or Windows?

Compiled on a Mac.

It looks like your include paths are not set up correctly in your module or something like that, or you have some #includes inside #if statements that aren’t true for iOS.

No #includes in the project except for the *.generated.h and other project source files.

I’ve tried compiling from Xcode and I see that the errors are in GestureRecognizer.h, but since my project is named “GestureRecognizer”, there was a GestureRecognizer.h file auto-created in my project. I wonder if that’s the source of the problem. Other projects seem to be building fine.

Wait, so there are two things (modules, projects, something?) called GestureRecognizer? I’m slightly confused about the setup here, sorry :slight_smile:

The project itself is called GestureRecognizer, so it generated a file called GestureRecognizer.h. The FGestureRecognizer class is also contained in a file called GestureRecognizer.h, so I’m wondering if that’s causing the wrong file to be included. Going to try creating a new project with a different name to test this out.

Tomorrow. :slight_smile: