Exposing c++ bus to lua : error C2338: You should use AZ_TYPE_INFO or AZ_RTTI in your class/struct

7616-geminiwebsocket.zip (10.4 KB)geminiwebsocket.zip

Hi,

First thanks for your work on Lumberyard, I like almost everything in it, but I’m kind of stuck in my progression because of this issue. I may have missed some important point in the docs, thougth I
read some of it multiple time.

My goal is to have a component acting as a request bus handler, and expose its API to LUA. I’ve managed
to have the component being exposed into the editor, unsing the Reflect
method and the editContext, I have also added the command to record my component into the BehaviourContext.

My Component in his header is defining the AZ_COMPONENT macro.

Now when I compile I’m getting this error :

        $ ./lmbr_waf.bat build_win_x64_vs2015_profile -p game
[WAF] Engine Root: C:\Amazon\Lumberyard\1.15.0.0\dev\
A custom BuildEnv.json file was not found. This build will be untagged.
A custom BuildEnv.json file was not found. This build will be untagged.
[WAF] Executing 'build_win_x64_vs2015_profile' in 'c:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile'
[WARNING] Incredibuild disabled by build option
Missing signature for node c:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Source\IXWebSocket\ixwebsocket\IXWebSocket.h (dependency will not be tracked)
Missing signature for node c:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Source\IXWebSocket\ixwebsocket\IXWebSocketTransport.h (dependency will not be tracked)
[2178/4278] cxx (win_x64_vs2015|profile): Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp -> BinTemp\win_x64_vs2015_profile\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp.5040155.obj
[2179/4278] cxx (win_x64_vs2015|profile): Gems\GeminiWebsocket\Code\Source\GeminiWebsocketModule.cpp -> BinTemp\win_x64_vs2015_profile\Gems\GeminiWebsocket\Code\Source\GeminiWebsocketModule.cpp.5040155.obj
[2214/4278] cxx (win_x64_vs2015|profile): Gems\Maestro\Code\Source\Cinematics\SceneNode.cpp -> BinTemp\win_x64_vs2015_profile\Gems\Maestro\Code\Source\Cinematics\SceneNode.cpp.3565833.obj
[2215/4278] cxx (win_x64_vs2015|profile): Gems\Maestro\Code\Source\Cinematics\ScreenFaderTrack.cpp -> BinTemp\win_x64_vs2015_profile\Gems\Maestro\Code\Source\Cinematics\ScreenFaderTrack.cpp.3565833.obj
GeminiWebsocket.cpp
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/TypeInfo.h(228): error C2338: You should use AZ_TYPE_INFO or AZ_RTTI in your class/struct, or use AZ_TYPE_INFO_SPECIALIZE() externally. Make sure to include the header containing this information (usually your class header).
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/TypeInfo.h(392): note: see reference to class template instantiation 'AZ::AzTypeInfo<T,false>' being compiled
with
[
T=string
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/TypeInfo.h(392): note: while compiling class template member function 'const AZ::TypeId &AZ::AzTypeInfo<const string &,false>::Uuid(void)'
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3245): note: see reference to function template instantiation 'const AZ::TypeId &AZ::AzTypeInfo<const string &,false>::Uuid(void)' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3245): note: see reference to class template instantiation 'AZ::AzTypeInfo<const string &,false>' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3286): note: see reference to function template instantiation 'void AZ::Internal::SetParametersStripped<const string&>(AZ::BehaviorParameter *,AZ::OnDemandReflectionOwner *)' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3766): note: see reference to function template instantiation 'void AZ::Internal::SetParameters<const string&>(AZ::BehaviorParameter *,AZ::OnDemandReflectionOwner *)' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3762): note: while compiling class template member function 'AZ::Internal::BehaviorEBusEvent<EBus,AZ::Internal::BE_BROADCAST,void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>::BehaviorEBusEvent(void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &),AZ::BehaviorContext *)'
with
[
EBus=GeminiWebsocket::GeminiWebsocketRequestsBus
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(2231): note: see reference to function template instantiation 'AZ::Internal::BehaviorEBusEvent<EBus,AZ::Internal::BE_BROADCAST,void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>::BehaviorEBusEvent(void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &),AZ::BehaviorContext *)' being compiled
with
[
EBus=GeminiWebsocket::GeminiWebsocketRequestsBus
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(2231): note: see reference to class template instantiation 'AZ::Internal::BehaviorEBusEvent<EBus,AZ::Internal::BE_BROADCAST,void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>' being compiled
with
[
EBus=GeminiWebsocket::GeminiWebsocketRequestsBus
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3048): note: see reference to function template instantiation 'void AZ::BehaviorEBusEventSender::Set<Bus,Function>(Event,AZ::BehaviorContext *)' being compiled
with
[
Bus=GeminiWebsocket::GeminiWebsocketRequestsBus,
Function=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &),
Event=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3037): note: see reference to function template instantiation 'AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus> *AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus>::Event<Function>(const char *,Function,const char *,const AZStd::array<AZ::BehaviorParameterOverrides,1> &)' being compiled
with
[
Function=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3037): note: see reference to function template instantiation 'AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus> *AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus>::Event<Function>(const char *,Function,const char *,const AZStd::array<AZ::BehaviorParameterOverrides,1> &)' being compiled
with
[
Function=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp(33): note: see reference to function template instantiation 'AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus> *AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus>::Event<void(__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>(const char *,Function,const char *)' being compiled
with
[
Function=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp(35): note: see reference to function template instantiation 'AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus> *AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus>::Event<void(__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>(const char *,Function,const char *)' being compiled
with
[
Function=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)
]
Build failed
<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
Compilation failed - File: 'GeminiWebsocket.cpp.5040155.obj', Module: 'GeminiWebsocket', Configuration: 'win_x64_vs2015|profile', error code 2
Input Files: 'c:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp'
Output Files: 'c:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp.5040155.obj'
Command: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\CL.exe /nologo /W3 /WX /MP /Gy /GF /Gm- /fp:fast /Zc:wchar_t /Zc:forScope /Zc:inline /Gd /wd4530 /wd4577 /Ox /Ob2 /Ot /Oi /Oy- /FS /bigobj /GR- /showIncludes /MD /Z7 /YuGeminiWebsocket_precompiled.h /Fpc:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket_precompiled.5040155.pch /Ic:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Gems\GeminiWebsocket\Code /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code /IC:\Amazon\Lumberyard\1.15.0.0\3rdParty\boost\1.61.0-az.2 /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Code\CryEngine\CryCommon /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Include /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Source /Ic:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Gems\CryLegacy\Code\Source\CryAction /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Gems\CryLegacy\Code\Source\CryAction /Ic:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Code\Framework\AzFramework /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzFramework /Ic:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Code\Framework\GridMate /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\GridMate /Ic:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Code\Framework\AzCore /Ic:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore /IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE /IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE /IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt /IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um /IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\shared /IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um /IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt /IC:\Amazon\Lumberyard\1.15.0.0\3rdParty\rapidjson\rapidjson-1.0.2.1\include /IC:\Amazon\Lumberyard\1.15.0.0\3rdParty\rapidxml\1.13-modified.1\include /IC:\Amazon\Lumberyard\1.15.0.0\3rdParty\Lua\5.1.1.8-az /IC:\Amazon\Lumberyard\1.15.0.0\3rdParty\zlib\1.2.8-pkg.2\include /D_WIN32 /D_WIN64 /DCODE_BASE_FOLDER="c:/Amazon/Lumberyard/1.15.0.0/dev/Code/" /D_PROFILE /DPROFILE /DNDEBUG /DEXE_VERSION_INFO_0=1 /DEXE_VERSION_INFO_1=15 /DEXE_VERSION_INFO_2=0 /DEXE_VERSION_INFO_3=0 /D_CRT_SECURE_NO_WARNINGS /DBINFOLDER_NAME="Bin64vc140" /DPLATFORM_SUPPORTS_AWS_NATIVE_SDK /DUSE_WINDOWS_DLL_SEMANTICS /DLY_BUILD=664281 /D_MT /D_DLL /DAZ_ENABLE_TRACING /DAZ_ENABLE_DEBUG_TOOLS c:\Amazon\Lumberyard\1.15.0.0\dev\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp /c /Fo c:\Amazon\Lumberyard\1.15.0.0\dev\BinTemp\win_x64_vs2015_profile\Gems\GeminiWebsocket\Code\Source\GeminiWebsocket.cpp.5040155.obj'
Output:
GeminiWebsocket.cpp
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/TypeInfo.h(228): error C2338: You should use AZ_TYPE_INFO or AZ_RTTI in your class/struct, or use AZ_TYPE_INFO_SPECIALIZE() externally. Make sure to include the header containing this information (usually your class header).
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/TypeInfo.h(392): note: see reference to class template instantiation 'AZ::AzTypeInfo<T,false>' being compiled
with
[
T=string
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/TypeInfo.h(392): note: while compiling class template member function 'const AZ::TypeId &AZ::AzTypeInfo<const string &,false>::Uuid(void)'
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3245): note: see reference to function template instantiation 'const AZ::TypeId &AZ::AzTypeInfo<const string &,false>::Uuid(void)' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3245): note: see reference to class template instantiation 'AZ::AzTypeInfo<const string &,false>' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3286): note: see reference to function template instantiation 'void AZ::Internal::SetParametersStripped<const string&>(AZ::BehaviorParameter *,AZ::OnDemandReflectionOwner *)' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3766): note: see reference to function template instantiation 'void AZ::Internal::SetParameters<const string&>(AZ::BehaviorParameter *,AZ::OnDemandReflectionOwner *)' being compiled
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3762): note: while compiling class template member function 'AZ::Internal::BehaviorEBusEvent<EBus,AZ::Internal::BE_BROADCAST,void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>::BehaviorEBusEvent(void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &),AZ::BehaviorContext *)'
with
[
EBus=GeminiWebsocket::GeminiWebsocketRequestsBus
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(2231): note: see reference to function template instantiation 'AZ::Internal::BehaviorEBusEvent<EBus,AZ::Internal::BE_BROADCAST,void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>::BehaviorEBusEvent(void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &),AZ::BehaviorContext *)' being compiled
with
[
EBus=GeminiWebsocket::GeminiWebsocketRequestsBus
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(2231): note: see reference to class template instantiation 'AZ::Internal::BehaviorEBusEvent<EBus,AZ::Internal::BE_BROADCAST,void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)>' being compiled
with
[
EBus=GeminiWebsocket::GeminiWebsocketRequestsBus
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3048): note: see reference to function template instantiation 'void AZ::BehaviorEBusEventSender::Set<Bus,Function>(Event,AZ::BehaviorContext *)' being compiled
with
[
Bus=GeminiWebsocket::GeminiWebsocketRequestsBus,
Function=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &),
Event=void (__cdecl GeminiWebsocket::GeminiWebsocketRequests::* )(const string &)
]
c:\Amazon\Lumberyard\1.15.0.0\dev\Code\Framework\AzCore\AzCore/RTTI/BehaviorContext.h(3037): note: see reference to function template instantiation 'AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus> *AZ::BehaviorContext::EBusBuilder<GeminiWebsocket::GeminiWebsocketRequestsBus>::Event<Function>(const char *,Function,const char *,const AZStd::array<AZ::BehaviorParameterOverrides,1> &)' being compiled
with

I’ve been trying many things, like adding AZ_RTTI into my bus class definition, but it doesn’t seem to have any effect.

I’m
pretty sure the solution is easy, that I am missing something, but there is now 4 days I’m searching and running out of ideas :slight_smile:

I’m joining an archive with my Gem’s code in case it would help anyone…to help me :slight_smile:

Thank you,
Yan.

P.S :

Hi, I have also tried to have my component inherit from

  1. AZ::BehaviorEBusHandler
    but when I’m adding the macro :

  2. AZ_EBUS_BEHAVIOR_BINDER
    to my component class header, AZ_EBUS_BEHAVIOR_BINDER is conflicting with the AZ_COMPONENT macro of my componennt.

Just solved the issue. Into GeminiWebsocket::Configure_url(string Url), the Url as input parameter was laking RTTI info as not part of AZ framework. Changing it to const AZStd::string& url
fixed the issue.