Raised This Month: $203 Target: $400

Declare one hook in multiple cpp files

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Veteran Member
Join Date: Nov 2012
Old 05-27-2021 , 16:41   Declare one hook in multiple cpp files
Reply With Quote #1

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/lderrorfileone.omultiple definition of '__SourceHook_FHAddIServerEntitySetModelIndex(void*, SourceHook::ISourceHook::AddHookMode, bool, fastdelegate::FastDelegate1<int, void>)'
/usr/bin/ldfiletwo.oprevious definition here
/usr/bin/lderrorfileone.omultiple definition of '__SourceHook_FHRemoveIServerEntitySetModelIndex(void*, bool, fastdelegate::FastDelegate1<int, void>)'
/usr/bin/ldfiletwo.oprevious definition here
errorld returned 1 exit status 
Is there a beautiful way to solve this problem?
kadet.89 is offline
Send a message via Skype™ to kadet.89

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 14:17.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode