Announcement

Collapse
No announcement yet.

4.15 C++ Transition Guide

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    4.15 C++ Transition Guide

    Dear Community,

    4.15 is here! Yay!

    Post any questions or compile errors you figured out solutions for here!

    Also any questions regarding changes between prior engine versions and 4.15 are welcome here

    ~~~

    Skeletal Mesh

    If you were using types defined in SkeletalMeshTypes.h, you may now need to include this file explicitly.

    ~~~

    What is IWYU?

    IWYU stands for "Include What You Use", indicating that you have to manually include all headers for all engine code that you want to use rather than simply including large headers like one of my personal favorites, Engine.h, hee hee!

    Here is the github commit where Epic's Ben Marsh explains more:

    https://forums.unrealengine.com/show...l=1#post627943

    ~~~

    Disabling IWYU

    You can disable the new system by adding

    Code:
    bEnforceIWYU = false;
    in your build.cs.

    ~~~

    Why IWYU?

    If you go through the work of finding and manually including all headers you need for the engine code you are using per file, then you stand the chance of seeing 20 to 50% improvement in your compile times

    ~~~

    GEngine? ( * Sniff * )

    Epic's Ben Marsh (who was instrumental in arrival of IWYU) explains how to get access to GEngine here:
    https://forums.unrealengine.com/show...l=1#post673109



    Rama
    Last edited by Rama; 02-27-2017, 08:09 PM.
    100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

    UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

    Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

    #2
    UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms() doesn't exist anymore.

    If you have a dedicated server target (MyGameServer.Target.cs), I believe the correct way to define the platforms now is to annotate the class and delete the GetSupportedPlatforms method
    Code:
    [SupportedPlatforms(UnrealPlatformClass.Server)]
    public class MyGameServerTarget : TargetRules
    {
    ...
    }
    Haven't tried it yet but I'm seeing the same changes on Epic's commits at https://github.com/EpicGames/UnrealE...4a12b0001bfa8f

    Comment


      #3
      If you're using TEnumAsByte as class member, remove it and use the Enums directly. If you were using .GetValue() for those in code, just remove it

      Comment


        #4
        If you were using FAttenuationSettings in code, replace it with FSoundAttenuationSettings (It was renamed)

        Comment


          #5
          I'm on 4.13 and I can't convert to 4.14 or 4.15
          I only get a single error when compiling, and its from an engine file:
          Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	19.3 KB
ID:	1123124


          Click image for larger version

Name:	Capture2.JPG
Views:	1
Size:	52.8 KB
ID:	1123125

          The function it appears to be calling is here and seems to be in good order:
          Click image for larger version

Name:	Capture3.JPG
Views:	1
Size:	27.5 KB
ID:	1123126

          Whether updating to 4.14 or 4.15 I get the same error.

          Comment


            #6
            So what happens to our game header includes now? Does MyGame still need MyGame.h as the first include in every cpp file? What do I need to include in MyGame.h?
            [Submitted] Advanced Data Validation

            Comment


              #7
              Yeah I'm also wondering what the header changes mean for existing C++ projects ??
              UE4 Tutorials for 3rd person Blueprint project from scratch: Youtube Channel
              Use Blender 2.8 to make UE4 compatible animations: Blog

              Comment


                #8
                Had a 4.14 project that used Paper2D and wouldn't compile after upgrade, complaining about not knowing what a UPaperSpriteComponent was. Added include

                #include "Paper2DClasses.h"

                in my [project].h file and all was good

                Found tip here:
                http://alienpixelstudios.com/2017/02...ine-4-14-4-15/
                Last edited by SpirosMakris; 02-16-2017, 06:14 AM. Reason: Typo

                Comment


                  #9
                  Looks like the engine now creates a .suppressed file which will force you to include what you use instead of letting your headers make use of Core.h or Engine.h as a whole; so if you use classes from different modules you have to include those module's headers now, simply adding Engine.h won't work.


                  UUserDefinedEnums have changed; there's no more TArray<FName> DisplayNames, it's now a TMap<FName,FText> DisplayNamesMap.
                  If you do DisplayNamesMap.GenerateValueArray() you get the stored Enum names from there.
                  | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                  Comment


                    #10
                    I am trying to follow the "no Engine.h" paradigm so I removed the include to Engine.h from my MyGame.h file. However now I get weird errors, the first of which is in my interface:

                    2>/ActivationInterface.h(20): error C2065: 'P_FINISH': undeclared identifier
                    2>/ActivationInterface.h(20): error C2065: 'P_NATIVE_BEGIN': undeclared identifier
                    2>/ActivationInterface.h(20): error C2065: 'P_NATIVE_END': undeclared identifier
                    2>/ActivationInterface.h(20): error C2065: 'Z_Param_Out_InbForcedActive': undeclared identifier
                    2>/ActivationInterface.h(20): error C3861: 'P_GET_UBOOL_REF': identifier not found
                    2>/ActivationInterface.h(20): error C2065: 'P_FINISH': undeclared identifier
                    2>/ActivationInterface.h(20): error C2065: 'P_NATIVE_BEGIN': undeclared identifier
                    2>/ActivationInterface.h(20): error C2065: 'P_NATIVE_END': undeclared identifier
                    2>/ActivationInterface.h(20): error C2065: 'Z_Param_Out_InbForcedActive': undeclared identifier
                    2>/ActivationInterface.h(20): error C3861: 'P_GET_UBOOL_REF': identifier not found

                    Including Interface.h doesn't help, and this error happens in the GENERATED_IINTERFACE_BODY().

                    Anyone got any idea?
                    [Submitted] Advanced Data Validation

                    Comment


                      #11
                      I had a compile error saying that UE4EditorServices couldn't be compiled because it does not run on Win64 systems + I had no rights to run Build.bat.
                      Edit: Fixed by cleaning solution and rebuilding it.

                      To use "GEditor->" you now have to include "Editor.h" ( tested in plugin )

                      I also noticed this during compilation: Skipping MfMedia (requires WINVER >= 0x0601, but WINVER is 0x0601) well... it says WINVER greater or equal to 0x0601 so why skip?
                      Last edited by Iceey; 02-16-2017, 09:31 AM.
                      BP/C++ Programmer
                      Main developer of Ascension Of Heroes. @AscensionOfHeroes

                      Comment


                        #12
                        I understand the logic of the use of PCH file has been completely abandoned. Is it possible to revert to the old rules for the project? I would like to use the PCH file and do not add a number of .h files in each .h file.

                        Comment


                          #13
                          Now in each elementary .h file must be something like this:

                          #include "CoreMinimal.h"
                          #include "UObject/Object.h"
                          #include "UObject/WeakObjectPtr.h"

                          Comment


                            #14
                            Vehicles have been moved to a plugin, now you have to include "PhysXVehicles" in your build.cs.
                            Assets: Military Ammunition (Released)
                            Plugins: BlueManBPFunctionLibrary C++ plugin (Free), Blue Man Vehicle AI Plugin (Released), Air Resistance C++ Plugin (WIP), Blue Man Vehicle Physics Plugin (Marketplace)
                            Projects: Giants Of Destruction

                            Comment


                              #15
                              Substance plugin (from 4.14) has many compilation errors in 4.15 due to new rules for .h files

                              bEnforceIWYU = true enables warnings or errors about violations of these rules
                              bEnforceIWYU = false by defaults and there are no warnings or errors in our projects
                              Last edited by v.s.; 02-17-2017, 04:27 AM. Reason: Fix logic's description

                              Comment

                              Working...
                              X