I need to hook IServerEntity::SetModelIndex founction in multiple cpp files.
I do it this way in the first file:
SH_DECL_HOOK1_void(IServerEntity, SetModelIndex, SH_NOATTRIB, 0, int)
and in the second:
SH_DECL_HOOK1_void(IServerEntity, SetModelIndex, SH_NOATTRIB, 1, int)
I get this error:
PHP Code:
/usr/bin/ld: error: fileone.o: multiple definition of '__SourceHook_FHAddIServerEntitySetModelIndex(void*, SourceHook::ISourceHook::AddHookMode, bool, fastdelegate::FastDelegate1<int, void>)'
/usr/bin/ld: filetwo.o: previous definition here
/usr/bin/ld: error: fileone.o: multiple definition of '__SourceHook_FHRemoveIServerEntitySetModelIndex(void*, bool, fastdelegate::FastDelegate1<int, void>)'
/usr/bin/ld: filetwo.o: previous definition here
collect2: error: ld returned 1 exit status
Is there a beautiful way to solve this problem?