I see this macro in class declaration, for example:
class SURVIVALGAME_API USCarryObjectComponent : public USpringArmComponent
as in the sample game project. It says this macro cannot be found in the source file. I wonder where this macro exactly is and what does it mean? A similar macro I usually see is Engine_API, and I can’t find the definition of this one too.
From what I know, it basically exports functions that are marked with the macro (or all functions in class if class is marked with this macro) so they can be used outside of the module they were declared in. If you know, that you won’t use given class outside of the module you develop it in (for example if you write customizations for details panels in editor), you don’t need to export that functionality to other modules.
It increases performance a bit, but I’m not sure if just a compilation/building will be faster, or if a game will run faster too.
Thanks! I looked through it, and it doesn’t tell where it is defined. I am sorry but I am really curious about that. Could you give more explanations? Thanks!
I am simply curious about this macro since I have seen it in all c++ projects and I think knowing more about it might help me understand the engine better.
It pastes extern to make entire class or invidual functions to be callable outside of module dll. It is macro so extern can be skipped on monolith (exe only) build where extern is not needed only create security hole.