Announcement

Collapse
No announcement yet.

Is there a 4.22 C++ guide best practices somewhere?

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

    #16
    Originally posted by Juice-Tin View Post
    Few things that may help:

    1. In the .h files you usually don't need to have other header includes. If you're using other classes you can use 'class' in front to forward declare it.
    Ex:
    Code:
    UPROPERTY() class AUTGameState* GameState;
    That will compile fine, and will only need the header when used in the .cpp file, not in the .h file. This may clear up issues with things referencing each other in headers which is what it seems like that 'nested' error is.
    But that occurs in the .cpp file.

    Originally posted by Juice-Tin View Post
    3. Cached problems! Somethings things just don't work even though they should. Usually worth doing a full rebuild of the project, or deleting the intermediate folder, regenerating project files (right click the .uproject file) and rebuilding the game.
    This could fix odd compiler/game errors that just don't make sense (possibly the spacing errors).
    Maybe I wasn't clear enough. The error is detected by QT Creator as per the presence/absence of certain white spaces. That is weird and mysterious.
    https://ravimohan.net/
    https://github.com/ravimohan1991

    Comment


      #17
      Originally posted by The-Cowboy View Post
      Could you be more specific about the glue part? For instance the Party.generated.h looks like
      In other words, what new structure is provided by this file that cannot be achieved by traditional C++ compilation process (which don't involve .generated.h). On the local scale I understand that it supports the error spitting mechanism and all that, but what exactly does it stand for on global scale?
      Just a sound reference for the utility of ".generated.h" files the way I wanted https://answers.unrealengine.com/que...ml?sort=oldest
      https://ravimohan.net/
      https://github.com/ravimohan1991

      Comment

      Working...
      X