Raised This Month: $32 Target: $400
 8% 

SH_DECL_HOOK2 errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Afronanny
Veteran Member
Join Date: Aug 2009
Old 01-18-2013 , 15:28   SH_DECL_HOOK2 errors
Reply With Quote #1

I'm actually not sure what's wrong here. This line of code should be fine, but MSVC is giving me a million errors. These errors show up no matter where I put this line of code in the file, and removing this line also removes the compile errors.

Code:
SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int);
The errors are:
Code:
1>..\blazeit_mm.cpp(13): error C2589: 'string' : illegal token on right side of '::'
1>..\blazeit_mm.cpp(13): error C2589: 'string' : illegal token on right side of '::'
1>..\blazeit_mm.cpp(13): warning C4091: 'typedef ' : ignored on left of 'int' when no variable is declared
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing ';' before '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing ';' before '::'
1>..\blazeit_mm.cpp(13): error C2065: 'my_rettype' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2146: syntax error : missing ';' before identifier 'orig_ret'
1>..\blazeit_mm.cpp(13): error C2065: 'orig_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'my_rettype' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2146: syntax error : missing ';' before identifier 'override_ret'
1>..\blazeit_mm.cpp(13): error C2065: 'override_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'my_rettype' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2146: syntax error : missing ';' before identifier 'plugin_ret'
1>..\blazeit_mm.cpp(13): error C2065: 'plugin_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'orig_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'override_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'plugin_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2061: syntax error : identifier 'my_rettype'
1>..\blazeit_mm.cpp(13): error C2065: 'orig_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'orig_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'override_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2065: 'plugin_ret' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2061: syntax error : identifier 'my_rettype'
1>..\blazeit_mm.cpp(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing ';' before '*'
1>..\blazeit_mm.cpp(13): error C2065: 'retptr' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\blazeit_mm.cpp(13): error C2061: syntax error : identifier 'my_rettype'
1>..\blazeit_mm.cpp(13): error C2065: 'retptr' : undeclared identifier
1>..\blazeit_mm.cpp(13): error C2589: 'string' : illegal token on right side of '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing '}' before '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing '}' before '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing ';' before '::'
1>..\blazeit_mm.cpp(13): error C2059: syntax error : '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing ';' before '}'
1>..\blazeit_mm.cpp(13): error C2059: syntax error : '}'
1>..\blazeit_mm.cpp(13): error C2589: 'string' : illegal token on right side of '::'
1>..\blazeit_mm.cpp(13): error C2589: 'string' : illegal token on right side of '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing '}' before '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing '}' before '::'
1>..\blazeit_mm.cpp(13): error C2143: syntax error : missing ';' before '::'
1>..\blazeit_mm.cpp(13): error C2059: syntax error : '::'
Can anybody offer insight on the source of these errors, and perhaps what to do about it?

Last edited by Afronanny; 01-18-2013 at 15:32.
Afronanny is offline
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 01-20-2013 , 09:10   Re: SH_DECL_HOOK2 errors
Reply With Quote #2

First guess is that something is not being included. I was able to drop your code line into one of my MM:S plugins and it still compiled using VS2005. Haven't tried it on VS2008 or VS2010 but suspect it would still compile.

I do include "MRecipientFilter.h" which includes "irecipientfilter.h"

It looks like you want to hook "engine->UserMessageBegin" but do you just need to implement something like "SayText" which doesn't require hooking?
__________________
.......Chuck |TxA| Old and Slow [AARP]
Old and Slow is offline
Reply


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 07:46.


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