This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Declare one hook in multiple cpp files


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
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
collect2
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
 



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 10:13.


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