The most interesting part for me, which goes me crazy - if I define my method in *.h, everything works. But if in *.h I have only declaration and define this method in *.cpp I always get an error:
error LNK2019: unresolved external
symbol “public: int __cdecl
FTestModule::Test(int)”
(?Test@FTestModule@@QEAAHH@Z)
How are you defining your FTestModule::Test(int) in your cpp file?
Check that when you define in your cpp, you’re using
int FTestModule::Test(int Argument) { // your awesome code here }
and not just
int Test(int Argument) { //still your awesome code here }
Also, use int32 instead of int as the size of an int can vary between platforms (4 bytes on 32bit systems and 8 bytes on 64bit systems). int32 provides an integer type that is always 4 bytes in size.
Class functions are not automatically exported from modules. You have to mark up your Test() function with the export macro for your module, i.e.:
TESTMODULE_API void Test();
Alternatively, you can also export the entire module class, although that is probably overkill:
class TESTMODULE_API FTestModule
Note that the export macro is automatically generated for all your modules. The naming convention is MODULENAME_API where ‘MODULENAME’ is the all-uppercase version of your module’s name.
The type FAnalyticsET is never used outside of the AnalyticsET module. Instead it is accessed through the publicly known IAnalyticsProviderModule interface that it implements. This allows you to implement many different analytics providers without actually knowing any of them explicitly.