Raised This Month: $12 Target: $400
 3% 

Undefined Symbol errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 04-19-2019 , 05:52   Undefined Symbol errors
Reply With Quote #1

Hi Folks,

I'm receiving these errors for the below code

PHP Code:
D:\Libraries\Insurgency Development\Sourcemod\WIP\sourcemod\scripting\ozzy_respawn_v4.1.sp(957) : error 017undefined symbol "g_hGameConfig"
D:\Libraries\Insurgency Development\Sourcemod\WIP\sourcemod\scripting\ozzy_respawn_v4.1.sp(959) : error 017undefined symbol "g_hGameConfig"
D:\Libraries\Insurgency Development\Sourcemod\WIP\sourcemod\scripting\ozzy_respawn_v4.1.sp(968) : error 017undefined symbol "g_hGameConfig"
D:\Libraries\Insurgency Development\Sourcemod\WIP\sourcemod\scripting\ozzy_respawn_v4.1.sp(971) : error 017undefined symbol "g_hForceRespawn"
D:\Libraries\Insurgency Development\Sourcemod\WIP\sourcemod\scripting\ozzy_respawn_v4.1.sp(972) : error 017undefined symbol "g_hForceRespawn" 
PHP Code:
g_hGameConfig LoadGameConfigFile("insurgency.games");
    
    if (
g_hGameConfig == INVALID_HANDLE)
        
SetFailState("Fatal Error: Missing File \"insurgency.games\"!");

    
StartPrepSDKCall(SDKCall_Player);
    
char game[40];
    
GetGameFolderName(gamesizeof(game));
    
g_hPlayerRespawn EndPrepSDKCall();
    if (
StrEqual(game"insurgency"))
    {
        
PrepSDKCall_SetFromConf(g_hGameConfigSDKConf_Signature"ForceRespawn");
    }
    
    
g_hForceRespawn EndPrepSDKCall();
    if (
g_hForceRespawn == INVALID_HANDLE)
    {
        
SetFailState("Fatal Error: Unable to find signature for \"ForceRespawn\"!");
    } 
__________________
ozrich is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 04-19-2019 , 06:52   Re: Undefined Symbol errors
Reply With Quote #2

you didn't set handles

Put after includes
PHP Code:

new Handle:g_hGameConfig
new 
Handle:g_hForceRespawn

Last edited by farawayf; 04-19-2019 at 06:55.
farawayf is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 04-19-2019 , 07:47   Re: Undefined Symbol errors
Reply With Quote #3

Quote:
Originally Posted by farawayf View Post
you didn't set handles

Put after includes
PHP Code:

new Handle:g_hGameConfig
new 
Handle:g_hForceRespawn
Don't encourage people to use old syntax, especially if the code given to you is already in new syntax.
For new syntax you should use:
PHP Code:
Handle g_hGameConfig;
Handle g_hForceRespawn
CliptonHeist is offline
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 04-19-2019 , 08:21   Re: Undefined Symbol errors
Reply With Quote #4

Thanks Guys.

@CliptonHeist, I was going to use what you suggested, but I wasn't sure. The only issue now is when I compile I get
PHP Code:
warning 219local variable "g_hForceRespawn" shadows a variable at a preceding level 
It is not defined beforehand but is mentioned in some functions. It's also not in the include
__________________

Last edited by ozrich; 04-19-2019 at 08:29.
ozrich is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 04-19-2019 , 08:36   Re: Undefined Symbol errors
Reply With Quote #5

Quote:
Originally Posted by ozrich View Post
Thanks Guys.

@CliptonHeist, I was going to use what you suggested, but I wasn't sure. The only issue now is when I compile I get
PHP Code:
warning 219local variable "g_hForceRespawn" shadows a variable at a preceding level 
It is not defined beforehand but is mentioned in some functions. It's also not in the include
Is it defined somewhere other than at the top of the plugin in global vars? local variable warning makes me think that it's being defined elsewhere in the plugin. Could also just rename the global variable as long as it doesn't make anything else break.
CliptonHeist is offline
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 04-19-2019 , 08:44   Re: Undefined Symbol errors
Reply With Quote #6

Thanks. I moved it to the top of the plugin and that fixed it. I have a couple of more errors if you don't mind helping? If not that's cool.

I receive
PHP Code:
(841) : warning 213tag mismatch 
for line
PHP Code:
g_iCollOff FindSendPropInfo("CBaseEntity""m_CollisionGroup"); 
I believe I need to do a check for the Prop first?
__________________

Last edited by ozrich; 04-19-2019 at 08:44.
ozrich is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 04-19-2019 , 09:10   Re: Undefined Symbol errors
Reply With Quote #7

Quote:
Originally Posted by CliptonHeist View Post
Don't encourage people to use old syntax, especially if the code given to you is already in new syntax.
he did not say that plugin have newdecls required, so.
the code is not full, i can not know. on the new syntax, there is only line a supported games check.

and I gave an example, saying that he forgot to put the handle. Once he wrote this code, he should know how to put it.
And considering how stupid the mistake he made, i think he hardly distinguishes the new syntax from the old one, so I am sure that in his plugin both the old and the new syntax are used

Last edited by farawayf; 04-19-2019 at 09:14.
farawayf is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-19-2019 , 10:55   Re: Undefined Symbol errors
Reply With Quote #8

Quote:
Originally Posted by ozrich View Post
Thanks. I moved it to the top of the plugin and that fixed it. I have a couple of more errors if you don't mind helping? If not that's cool.

I receive
PHP Code:
(841) : warning 213tag mismatch 
for line
PHP Code:
g_iCollOff FindSendPropInfo("CBaseEntity""m_CollisionGroup"); 
I believe I need to do a check for the Prop first?
It is telling you that g_iCollOff is not the same type as what FindSendPropInfo returns (which is an int), but you haven't provided us the declaration for g_iCollOff so that is all that can be said.
__________________
asherkin is offline
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 04-19-2019 , 10:58   Re: Undefined Symbol errors
Reply With Quote #9

Thanks Asherkin, it's used in this

PHP Code:
public hideBot(any client)
{
    
SetEntProp(clientProp_Data"m_takedamage"01);
    
SetEntData(clientg_iCollOff24true);
    
set_rendering(clientg_Effect000g_Render0);

__________________
ozrich is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-19-2019 , 11:19   Re: Undefined Symbol errors
Reply With Quote #10

https://wiki.alliedmods.net/Introduc...wn#Variables_2

https://wiki.alliedmods.net/Introduc....7#Variables_2

Pick your syntactic preference, but I think you really need to spend some time learning the language and programming terminology a bit more.
__________________
asherkin 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 05:51.


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