How to Disable IOSTargetPlatform during Compilation

Hello everyone. I’m trying to hack on Unreal 4.8 to make Android targeting work with Ubuntu Linux. I made a good progress as AndroidTargetPlatform and everything else gets compiled successfully but I get error for IOSTargetPlatform.cpp. I don’t even want target iOS so I was wondering if there was a way to disable it to circumvent the error. There compilationg error is like this:

/bin/sh  -c '/bin/sh "/home/james/UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UE4Editor/Development/FixDependencies.sh" && touch "/home/james/UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UE4Editor/Development/UE4Editor.link"'
Performing 5 actions (3 in parallel)
[2/5] Compile Module.IOSTargetPlatform.cpp
[1/5] Compile Module.IOSPlatformEditor.cpp
In file included from /home/james/UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UE4Editor/Development/IOS/IOSTargetPlatform/Module.IOSTargetPlatform.cpp:3:
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:87:3: error: unknown type name 'HKEY'
                HKEY hKey;
                ^
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:88:3: error: unknown type name 'LRESULT'
                LRESULT lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Wow6432Node\\Apple Inc.\\Apple Mobile Device Support\\Shared"), 0, KEY_READ, &hKey);
                ^
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:88:31: error: use of undeclared identifier 'HKEY_LOCAL_MACHINE'
                LRESULT lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Wow6432Node\\Apple Inc.\\Apple Mobile Device Support\\Shared"), 0, KEY_READ, &hKey);
                                            ^
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:88:134: error: use of undeclared identifier 'KEY_READ'
                LRESULT lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Wow6432Node\\Apple Inc.\\Apple Mobile Device Support\\Shared"), 0, KEY_READ, &hKey);
                                                                                                                                                   ^
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:91:95: error: use of undeclared identifier 'BYTE'
                if (lRes != ERROR_SUCCESS || RegQueryValueEx(hKey, TEXT("iTunesMobileDeviceDLL"), 0, NULL, (BYTE*)dllPath, &pathSize) != ERROR_SUCCESS || IFileManager::Get().FileSize(*FString(dllPath)) == INDEX_NONE)
                                                                                                            ^
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:91:100: error: expected expression
                if (lRes != ERROR_SUCCESS || RegQueryValueEx(hKey, TEXT("iTunesMobileDeviceDLL"), 0, NULL, (BYTE*)dllPath, &pathSize) != ERROR_SUCCESS || IFileManager::Get().FileSize(*FString(dllPath)) == INDEX_NONE)
                                                                                                                 ^
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:93:65: error: use of undeclared identifier 'BYTE'
                        if (RegQueryValueEx(hKey, TEXT("MobileDeviceDLL"), 0, NULL, (BYTE*)dllPath, &pathSize) != ERROR_SUCCESS || IFileManager::Get().FileSize(*FString(dllPath)) == INDEX_NONE)
                                                                                     ^
/home/james/UnrealEngine/Engine/Source/Developer/iOSq/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:93:70: error: expected expression
                        if (RegQueryValueEx(hKey, TEXT("MobileDeviceDLL"), 0, NULL, (BYTE*)dllPath, &pathSize) != ERROR_SUCCESS || IFileManager::Get().FileSize(*FString(dllPath)) == INDEX_NONE)
                                                                                          ^
8 errors generated.
[3/5] Link libUE4Editor-IOSPlatformEditor.so
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: /home/james/UnrealEngine/Engine/Binaries/Linux/IOS/libUE4Editor-IOSTargetPlatform.so
Total build time: 42.85 seconds
Makefile:178: recipe for target 'UE4Editor' failed
make: *** [UE4Editor] Error 5

I would appreciate it if anyone have solution or idea for this. Thanks :slight_smile:

How did you include the AndroidTargetPlatform to the Linux build? Did you copy paste in the TargetPlatform.Build.cs? If so, you probably included IOSTargetPlatfrom on accident. Check that real quick and see if you have included IOSTargetPlatform in the Linux section of that file.

-Pete

@anonymous_user_f724fc9b You are right :slight_smile: got passed that problem now. Dealing with other errors now, Thanks a lot for your help :slight_smile: