Raised This Month: $319 Target: $400
 79%   Almost there!

Declare one hook in multiple cpp files

Post New Thread Reply   
Thread Tools Display Modes
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 20:55.

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