top of page

FORCEINLINE functions

  • Writer: Lee Choon Meng (Xynan)
    Lee Choon Meng (Xynan)
  • May 29, 2018
  • 1 min read

After a few attempts in building the game project, I could'nt get the project built because I kept getting LNK2001 and LNK2019 errors. Both of these errors mostly happen when a function was declared in the header file without a definition in the source file.

However it is different case for FORCEINLINE functions, they must be declared and defined in the header ONLY. Any definition in the source file will cause the errors mentioned above.


The CORRECT WAY

Header File


public:

FORCEINLINE AActor* GetActor() const { return actor; }


***Source File should have nothing to do with GetActor().

Recent Posts

See All
Unreal Automated Testing

As a Unreal video game developer, I can guarantee one of the most frustrating things in developing a game is the build you have cooked...

 
 
 

Comments


2020 by Xynan Lee.

  • LinkedIn
  • Instagram - Black Circle
bottom of page