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

undefined symbol from my own plugin


Post New Thread Reply   
 
Thread Tools Display Modes
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 01-14-2011 , 14:29   Re: undefined symbol from my own plugin
Reply With Quote #11

So ::Load is fixed? I assume yes.

We don't have info about the CSSPlayer_SwitchTeam function, so a general note:

If it is your own function, try the following:

1) Verify that the function is being compiled:
Place an invalid line of code inside the function's body like blablablablabla error error; or int errorarray[-100];
1.1) Error gets triggered: Remove the error line again. Then, make sure the object file resulting from the compilation gets linked.
The easiest way to do that would be to examine the output when you do a make command (maybe buffer it with a make | less command line) for readability.
The gcc invokation which produces the output .so file should contain the examined .o file as one of its inputs.

1.2) Error does not appear: Find out why the function is not being compiled.
Possibility A: File is not being compiled at all: It does not appear in make's output when changed (for example with a touch file command line).
Possibility B: The function is not being compiled. Make sure it is not hidden by #ifdefs.

There are of course many other possibilities but these are the main ones.
What also happens often in C is that the function definition is misspelled. But the probability of that is very low because the C++ compiler should find out if the defined function is not a class member.

Also note that there is a command for examining the not-yet-resolved-exports without you having to launch srcds or something.
I think it was ldd and I don't remember the command line parameters, feel free to explore.
__________________
hello, i am pm
PM is offline
sn4k3
Senior Member
Join Date: Nov 2005
Old 01-14-2011 , 17:34   Re: undefined symbol from my own plugin
Reply With Quote #12

Quote:
Originally Posted by PM View Post
So ::Load is fixed? I assume yes.

We don't have info about the CSSPlayer_SwitchTeam function, so a general note:

If it is your own function, try the following:

1) Verify that the function is being compiled:
Place an invalid line of code inside the function's body like blablablablabla error error; or int errorarray[-100];
1.1) Error gets triggered: Remove the error line again. Then, make sure the object file resulting from the compilation gets linked.
The easiest way to do that would be to examine the output when you do a make command (maybe buffer it with a make | less command line) for readability.
The gcc invokation which produces the output .so file should contain the examined .o file as one of its inputs.

1.2) Error does not appear: Find out why the function is not being compiled.
Possibility A: File is not being compiled at all: It does not appear in make's output when changed (for example with a touch file command line).
Possibility B: The function is not being compiled. Make sure it is not hidden by #ifdefs.

There are of course many other possibilities but these are the main ones.
What also happens often in C is that the function definition is misspelled. But the probability of that is very low because the C++ compiler should find out if the defined function is not a class member.

Also note that there is a command for examining the not-yet-resolved-exports without you having to launch srcds or something.
I think it was ldd and I don't remember the command line parameters, feel free to explore.
omg i found, it was very stealth, i have an unclosed #ifdef WIN32 in .cpp top :/
Thanks for all, this should solve

Last edited by sn4k3; 01-14-2011 at 17:45.
sn4k3 is offline
Send a message via MSN to sn4k3
voogru
Inspector Javert
Join Date: Oct 2004
Old 01-14-2011 , 17:57   Re: undefined symbol from my own plugin
Reply With Quote #13

Quote:
#define LIB_SIGSCAN_CLASS CSigScanLib
Quote:
class LIB_SIGSCAN_CLASS
{
Quote:
bool LIB_SIGSCAN_CLASS::Load(KeyValues *kvSigscan)

voogru is offline
sn4k3
Senior Member
Join Date: Nov 2005
Old 01-14-2011 , 17:58   Re: undefined symbol from my own plugin
Reply With Quote #14

Quote:
Originally Posted by voogru View Post
whats the problem with using that?
sn4k3 is offline
Send a message via MSN to sn4k3
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 01-15-2011 , 04:37   Re: undefined symbol from my own plugin
Reply With Quote #15

No, what sn4k3 has basically written is

Code:
#define LIB_SIGSCAN_CLASS CSigScanLib

// (.h file)
class LIB_SIGSCAN_CLASS
{ 
  bool Load(KeyValues *kvSigscan);
  // ...
};

// (.cpp file)
bool LIB_SIGSCAN_CLASS::Load(KeyValues *kvSigscan) {
   // function body
}
So he declares class CSigScanLib, where he declares the Load function.
Then in the .cpp file he provides the function definition of CSigScanLib::Load.
This is valid C++ code and will compile&link properly.

I don't see a reason to use the preprocessor macro there but it also doesn't do any harm.
__________________
hello, i am pm
PM is offline
voogru
Inspector Javert
Join Date: Oct 2004
Old 01-15-2011 , 09:06   Re: undefined symbol from my own plugin
Reply With Quote #16

Quote:
Originally Posted by PM View Post
No, what sn4k3 has basically written is

Code:
#define LIB_SIGSCAN_CLASS CSigScanLib
 
// (.h file)
class LIB_SIGSCAN_CLASS
{ 
  bool Load(KeyValues *kvSigscan);
  // ...
};
 
// (.cpp file)
bool LIB_SIGSCAN_CLASS::Load(KeyValues *kvSigscan) {
   // function body
}
So he declares class CSigScanLib, where he declares the Load function.
Then in the .cpp file he provides the function definition of CSigScanLib::Load.
This is valid C++ code and will compile&link properly.

I don't see a reason to use the preprocessor macro there but it also doesn't do any harm.
It doesn't do any harm.

But for the life of me I can't think of why someone would use a #define macro that is longer than the actual class name for a class name.

The only case I can see that being done is by an employee of a large corporation that is trying to get more typing done without actually accomplishing anything more.

voogru is offline
sn4k3
Senior Member
Join Date: Nov 2005
Old 01-16-2011 , 14:02   Re: undefined symbol from my own plugin
Reply With Quote #17

its just for keep things more clean, also if i change class name ...

longer than class name? true but i use also shorter defines. See at code bottom

PHP Code:
//=================================================================================
// Following Constans, define what libs to use on the plugin and thier variables
// Allow disable or enable NO-STATIC Libraries from plugin.
// They will be always avaliable to use, but aren't pre defenied by plugintemplate
// Never change define name
// Comment to disable
//=================================================================================
#define USE_LIB_DOWNLOAD
#define USE_LIB_SOUND
#define USE_LIB_PLAYERMNGR
#define USE_LIB_TIMER
#define USE_LIB_PROFILING
#define USE_LIB_ADMIN
#define USE_LIB_EASYADMIN
#define USE_LIB_LANG
#define USE_LIB_MENU
#define USE_LIB_PROP
#define USE_LIB_VFUNCS
#define USE_LIB_SIGSCAN

//=================================================================================
// Define libraries variables to use on plugin
// Never change define name
// l = library
//=================================================================================
#define VAR_LIB_DOWNLOAD    glDownload
#define VAR_LIB_SOUND        glSound
#define VAR_LIB_PLAYERMNGR    glPlayerMngr
#define VAR_LIB_TIMER        glTimer
#define VAR_LIB_PROFILING    glProfiling
#define VAR_LIB_ADMIN        glAdmin
#define VAR_LIB_EASYADMIN    glEasyAdmin
#define VAR_LIB_LANG        glLang
#define VAR_LIB_MENU        glMenu
#define VAR_LIB_HACK        glHack
// Do not touch this three
#define VAR_LIB_PROP        VAR_LIB_HACK->Props
#define VAR_LIB_VFUNCS        VAR_LIB_HACK->VFuncs
#define VAR_LIB_SIGSCAN        VAR_LIB_HACK->SigScan

//=================================================================================
// Short and nice typed re-defenitions from libraries variables
// You can change define name to your prefered name
// v = var, l = library
//=================================================================================
#define vlDownload            VAR_LIB_DOWNLOAD
#define vlSound                VAR_LIB_SOUND
#define vlPlayerMngr        VAR_LIB_PLAYERMNGR
#define vlTimer                VAR_LIB_TIMER
#define vlProfiling            VAR_LIB_PROFILING
#define vlAdmin                VAR_LIB_ADMIN
#define vlEasyAdmin            VAR_LIB_EASYADMIN
#define vlLang                VAR_LIB_LANG
#define vlMenu                VAR_LIB_MENU
#define vlHack                VAR_LIB_HACK
#define vlProp                VAR_LIB_PROP
#define vlVFuncs            VAR_LIB_VFUNCS
#define vlVSigscan            VAR_LIB_SIGSCAN 
i do the same for the interfaces:

PHP Code:
//=================================================================================
// Disable or enable interfaces from plugin.
// They will be always avaliable to use, but aren't pre defenied by plugintemplate
// Never change define name
// Comment to disable
//=================================================================================
#define USE_IFACE_BOTMANAGER            // (IBotManager)
#define USE_IFACE_VOICESERVER            // (IVoiceServer)
#define USE_IFACE_GAMEEVENTMANAGER        // (IGameEventManager2)
#define USE_IFACE_EFFECTS                // (IEffects)
#define USE_IFACE_ENGINETRACE            // (IEngineTrace)
#define USE_IFACE_SERVERGAMEENTS        // (IServerGameEnts)
#define USE_IFACE_SERVERCLIENTS            // (IServerGameClients)
#define USE_IFACE_RANDOMSTREAM            // (IUniformRandomStream)
#define USE_IFACE_SOUNDS                // (IEngineSound)
#define USE_IFACE_NETWORKSTRINGTABLE    // (NetworkStringTableContainer)


//=================================================================================
// Following Constans, define plugin interfaces variables names
// Methods under [] is where interface got used
//=================================================================================

#define VAR_IFACE_ENGINE                engine                    // Must use (IVEngineServer)
#define VAR_IFACE_PLAYERINFOMANAGER        playerinfomanager        // Must use (IPlayerInfoManager)
#define VAR_IFACE_SERVERPLUGINHELPERS    helpers                    // Must use (IServerPluginHelpers)
#define VAR_IFACE_ICVAR                    icvar                    // Must use (ICvar)
#define VAR_IFACE_SERVERGAMEDLL            servergamedll            // Must use (IServerGameDLL)
#define VAR_IFACE_FILESYSTEM            filesystem                // Must use (IFileSystem)
#define VAR_IFACE_GLOBALVARS            gpGlobals                // Must use (CGlobalVars)

#define VAR_IFACE_BOTMANAGER            botmanager                // Optional (IBotManager)
#define VAR_IFACE_VOICESERVER            voiceserver                // Optional (IVoiceServer)
#define VAR_IFACE_GAMEEVENTMANAGER        gameeventmanager        // Optional (IGameEventManager2)
#define VAR_IFACE_EFFECTS                effects                    // Optional (IEffects)
#define VAR_IFACE_ENGINETRACE            enginetrace                // Optional (IEngineTrace)
#define VAR_IFACE_SERVERGAMEENTS        serverents                // Optional (IServerGameEnts) [GetEntityFromBaseEntity]
#define VAR_IFACE_SERVERCLIENTS            serverclients            // Optional (IServerGameClients) [GetPlayerStatefromEdict, metamod plugin hooks]
#define VAR_IFACE_RANDOMSTREAM            randomStr                // Optional (IUniformRandomStream) [GetEntityOfRandPlayer and GetIndexOfRandPlayer]
#define VAR_IFACE_SOUNDS                esounds                    // Optional (IEngineSound) [EmitSound, PrecacheSound]
#define VAR_IFACE_NETWORKSTRINGTABLE    networkstringtable        // Optional (NetworkStringTableContainer) [Downloads]


//=================================================================================
// Short and nice typed re-defenitions from interfaces variables
// You can change define name to your prefered name
// v = var, i = interface
//=================================================================================

#define viEngine                        VAR_IFACE_ENGINE
#define viPlayerinfomanager                VAR_IFACE_PLAYERINFOMANAGER
#define viHelpers                        VAR_IFACE_SERVERPLUGINHELPERS
#define viICvar                            VAR_IFACE_ICVAR
#define viServerdll                        VAR_IFACE_SERVERGAMEDLL
#define viFilesystem                    VAR_IFACE_FILESYSTEM
#define viGlobals                        VAR_IFACE_GLOBALVARS

#define viBotmanager                    VAR_IFACE_BOTMANAGER
#define viVoiceserver                    VAR_IFACE_VOICESERVER
#define viGameeventmanager                VAR_IFACE_GAMEEVENTMANAGER
#define viEffects                        VAR_IFACE_EFFECTS
#define viEnginetrace                    VAR_IFACE_ENGINETRACE
#define viServerclients                    VAR_IFACE_SERVERGAMEENTS
#define viRandomStr                        VAR_IFACE_RANDOMSTREAM
#define viEsounds                        VAR_IFACE_SOUNDS
#define viNetworkstringtable            VAR_IFACE_NETWORKSTRINGTABLE 
sn4k3 is offline
Send a message via MSN to sn4k3
voogru
Inspector Javert
Join Date: Oct 2004
Old 01-23-2011 , 05:47   Re: undefined symbol from my own plugin
Reply With Quote #18

Quote:
Originally Posted by sn4k3 View Post
its just for keep things more clean, also if i change class name ...

longer than class name? true but i use also shorter defines. See at code bottom

PHP Code:
//=================================================================================
// Following Constans, define what libs to use on the plugin and thier variables
// Allow disable or enable NO-STATIC Libraries from plugin.
// They will be always avaliable to use, but aren't pre defenied by plugintemplate
// Never change define name
// Comment to disable
//=================================================================================
#define USE_LIB_DOWNLOAD
#define USE_LIB_SOUND
#define USE_LIB_PLAYERMNGR
#define USE_LIB_TIMER
#define USE_LIB_PROFILING
#define USE_LIB_ADMIN
#define USE_LIB_EASYADMIN
#define USE_LIB_LANG
#define USE_LIB_MENU
#define USE_LIB_PROP
#define USE_LIB_VFUNCS
#define USE_LIB_SIGSCAN
 
//=================================================================================
// Define libraries variables to use on plugin
// Never change define name
// l = library
//=================================================================================
#define VAR_LIB_DOWNLOAD    glDownload
#define VAR_LIB_SOUND        glSound
#define VAR_LIB_PLAYERMNGR    glPlayerMngr
#define VAR_LIB_TIMER        glTimer
#define VAR_LIB_PROFILING    glProfiling
#define VAR_LIB_ADMIN        glAdmin
#define VAR_LIB_EASYADMIN    glEasyAdmin
#define VAR_LIB_LANG        glLang
#define VAR_LIB_MENU        glMenu
#define VAR_LIB_HACK        glHack
// Do not touch this three
#define VAR_LIB_PROP        VAR_LIB_HACK->Props
#define VAR_LIB_VFUNCS        VAR_LIB_HACK->VFuncs
#define VAR_LIB_SIGSCAN        VAR_LIB_HACK->SigScan
 
//=================================================================================
// Short and nice typed re-defenitions from libraries variables
// You can change define name to your prefered name
// v = var, l = library
//=================================================================================
#define vlDownload            VAR_LIB_DOWNLOAD
#define vlSound                VAR_LIB_SOUND
#define vlPlayerMngr        VAR_LIB_PLAYERMNGR
#define vlTimer                VAR_LIB_TIMER
#define vlProfiling            VAR_LIB_PROFILING
#define vlAdmin                VAR_LIB_ADMIN
#define vlEasyAdmin            VAR_LIB_EASYADMIN
#define vlLang                VAR_LIB_LANG
#define vlMenu                VAR_LIB_MENU
#define vlHack                VAR_LIB_HACK
#define vlProp                VAR_LIB_PROP
#define vlVFuncs            VAR_LIB_VFUNCS
#define vlVSigscan            VAR_LIB_SIGSCAN 
i do the same for the interfaces:

PHP Code:
//=================================================================================
// Disable or enable interfaces from plugin.
// They will be always avaliable to use, but aren't pre defenied by plugintemplate
// Never change define name
// Comment to disable
//=================================================================================
#define USE_IFACE_BOTMANAGER            // (IBotManager)
#define USE_IFACE_VOICESERVER            // (IVoiceServer)
#define USE_IFACE_GAMEEVENTMANAGER        // (IGameEventManager2)
#define USE_IFACE_EFFECTS                // (IEffects)
#define USE_IFACE_ENGINETRACE            // (IEngineTrace)
#define USE_IFACE_SERVERGAMEENTS        // (IServerGameEnts)
#define USE_IFACE_SERVERCLIENTS            // (IServerGameClients)
#define USE_IFACE_RANDOMSTREAM            // (IUniformRandomStream)
#define USE_IFACE_SOUNDS                // (IEngineSound)
#define USE_IFACE_NETWORKSTRINGTABLE    // (NetworkStringTableContainer)
 
 
//=================================================================================
// Following Constans, define plugin interfaces variables names
// Methods under [] is where interface got used
//=================================================================================
 
#define VAR_IFACE_ENGINE                engine                    // Must use (IVEngineServer)
#define VAR_IFACE_PLAYERINFOMANAGER        playerinfomanager        // Must use (IPlayerInfoManager)
#define VAR_IFACE_SERVERPLUGINHELPERS    helpers                    // Must use (IServerPluginHelpers)
#define VAR_IFACE_ICVAR                    icvar                    // Must use (ICvar)
#define VAR_IFACE_SERVERGAMEDLL            servergamedll            // Must use (IServerGameDLL)
#define VAR_IFACE_FILESYSTEM            filesystem                // Must use (IFileSystem)
#define VAR_IFACE_GLOBALVARS            gpGlobals                // Must use (CGlobalVars)
 
#define VAR_IFACE_BOTMANAGER            botmanager                // Optional (IBotManager)
#define VAR_IFACE_VOICESERVER            voiceserver                // Optional (IVoiceServer)
#define VAR_IFACE_GAMEEVENTMANAGER        gameeventmanager        // Optional (IGameEventManager2)
#define VAR_IFACE_EFFECTS                effects                    // Optional (IEffects)
#define VAR_IFACE_ENGINETRACE            enginetrace                // Optional (IEngineTrace)
#define VAR_IFACE_SERVERGAMEENTS        serverents                // Optional (IServerGameEnts) [GetEntityFromBaseEntity]
#define VAR_IFACE_SERVERCLIENTS            serverclients            // Optional (IServerGameClients) [GetPlayerStatefromEdict, metamod plugin hooks]
#define VAR_IFACE_RANDOMSTREAM            randomStr                // Optional (IUniformRandomStream) [GetEntityOfRandPlayer and GetIndexOfRandPlayer]
#define VAR_IFACE_SOUNDS                esounds                    // Optional (IEngineSound) [EmitSound, PrecacheSound]
#define VAR_IFACE_NETWORKSTRINGTABLE    networkstringtable        // Optional (NetworkStringTableContainer) [Downloads]
 
 
//=================================================================================
// Short and nice typed re-defenitions from interfaces variables
// You can change define name to your prefered name
// v = var, i = interface
//=================================================================================
 
#define viEngine                        VAR_IFACE_ENGINE
#define viPlayerinfomanager                VAR_IFACE_PLAYERINFOMANAGER
#define viHelpers                        VAR_IFACE_SERVERPLUGINHELPERS
#define viICvar                            VAR_IFACE_ICVAR
#define viServerdll                        VAR_IFACE_SERVERGAMEDLL
#define viFilesystem                    VAR_IFACE_FILESYSTEM
#define viGlobals                        VAR_IFACE_GLOBALVARS
 
#define viBotmanager                    VAR_IFACE_BOTMANAGER
#define viVoiceserver                    VAR_IFACE_VOICESERVER
#define viGameeventmanager                VAR_IFACE_GAMEEVENTMANAGER
#define viEffects                        VAR_IFACE_EFFECTS
#define viEnginetrace                    VAR_IFACE_ENGINETRACE
#define viServerclients                    VAR_IFACE_SERVERGAMEENTS
#define viRandomStr                        VAR_IFACE_RANDOMSTREAM
#define viEsounds                        VAR_IFACE_SOUNDS
#define viNetworkstringtable            VAR_IFACE_NETWORKSTRINGTABLE 



Quote:
#define VAR_IFACE_ENGINE engine // Must use (IVEngineServer)
#define VAR_IFACE_PLAYERINFOMANAGER playerinfomanager // Must use (IPlayerInfoManager)
#define VAR_IFACE_SERVERPLUGINHELPERS helpers // Must use (IServerPluginHelpers)
#define VAR_IFACE_ICVAR icvar // Must use (ICvar)
#define VAR_IFACE_SERVERGAMEDLL servergamedll // Must use (IServerGameDLL)
#define VAR_IFACE_FILESYSTEM filesystem // Must use (IFileSystem)
#define VAR_IFACE_GLOBALVARS gpGlobals // Must use (CGlobalVars)


Why would you want to type VAR_IFACE_ENGINE-> every time, instead of just... engine->



I was going to say something else totally useless. I hope you understand that I holding myself back on thick chains.

Instead, I will say something useful in an effort to help you.

Order yourself a copy of this book.

http://www.amazon.com/Effective-Spec...5714164&sr=8-1
voogru is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-24-2011 , 11:50   Re: undefined symbol from my own plugin
Reply With Quote #19

Quote:
Originally Posted by sn4k3 View Post
PHP Code:
//=================================================================================
// Following Constans, define what libs to use on the plugin and thier variables
// Allow disable or enable NO-STATIC Libraries from plugin.
// They will be always avaliable to use, but aren't pre defenied by plugintemplate
// Never change define name
// Comment to disable
//=================================================================================
#define USE_LIB_DOWNLOAD
#define USE_LIB_SOUND
#define USE_LIB_PLAYERMNGR
#define USE_LIB_TIMER
#define USE_LIB_PROFILING
#define USE_LIB_ADMIN
#define USE_LIB_EASYADMIN
#define USE_LIB_LANG
#define USE_LIB_MENU
#define USE_LIB_PROP
#define USE_LIB_VFUNCS
#define USE_LIB_SIGSCAN

//=================================================================================
// Define libraries variables to use on plugin
// Never change define name
// l = library
//=================================================================================
#define VAR_LIB_DOWNLOAD    glDownload
#define VAR_LIB_SOUND        glSound
#define VAR_LIB_PLAYERMNGR    glPlayerMngr
#define VAR_LIB_TIMER        glTimer
#define VAR_LIB_PROFILING    glProfiling
#define VAR_LIB_ADMIN        glAdmin
#define VAR_LIB_EASYADMIN    glEasyAdmin
#define VAR_LIB_LANG        glLang
#define VAR_LIB_MENU        glMenu
#define VAR_LIB_HACK        glHack
// Do not touch this three
#define VAR_LIB_PROP        VAR_LIB_HACK->Props
#define VAR_LIB_VFUNCS        VAR_LIB_HACK->VFuncs
#define VAR_LIB_SIGSCAN        VAR_LIB_HACK->SigScan

//=================================================================================
// Short and nice typed re-defenitions from libraries variables
// You can change define name to your prefered name
// v = var, l = library
//=================================================================================
#define vlDownload            VAR_LIB_DOWNLOAD
#define vlSound                VAR_LIB_SOUND
#define vlPlayerMngr        VAR_LIB_PLAYERMNGR
#define vlTimer                VAR_LIB_TIMER
#define vlProfiling            VAR_LIB_PROFILING
#define vlAdmin                VAR_LIB_ADMIN
#define vlEasyAdmin            VAR_LIB_EASYADMIN
#define vlLang                VAR_LIB_LANG
#define vlMenu                VAR_LIB_MENU
#define vlHack                VAR_LIB_HACK
#define vlProp                VAR_LIB_PROP
#define vlVFuncs            VAR_LIB_VFUNCS
#define vlVSigscan            VAR_LIB_SIGSCAN 
i do the same for the interfaces:

PHP Code:
//=================================================================================
// Disable or enable interfaces from plugin.
// They will be always avaliable to use, but aren't pre defenied by plugintemplate
// Never change define name
// Comment to disable
//=================================================================================
#define USE_IFACE_BOTMANAGER            // (IBotManager)
#define USE_IFACE_VOICESERVER            // (IVoiceServer)
#define USE_IFACE_GAMEEVENTMANAGER        // (IGameEventManager2)
#define USE_IFACE_EFFECTS                // (IEffects)
#define USE_IFACE_ENGINETRACE            // (IEngineTrace)
#define USE_IFACE_SERVERGAMEENTS        // (IServerGameEnts)
#define USE_IFACE_SERVERCLIENTS            // (IServerGameClients)
#define USE_IFACE_RANDOMSTREAM            // (IUniformRandomStream)
#define USE_IFACE_SOUNDS                // (IEngineSound)
#define USE_IFACE_NETWORKSTRINGTABLE    // (NetworkStringTableContainer)


//=================================================================================
// Following Constans, define plugin interfaces variables names
// Methods under [] is where interface got used
//=================================================================================

#define VAR_IFACE_ENGINE                engine                    // Must use (IVEngineServer)
#define VAR_IFACE_PLAYERINFOMANAGER        playerinfomanager        // Must use (IPlayerInfoManager)
#define VAR_IFACE_SERVERPLUGINHELPERS    helpers                    // Must use (IServerPluginHelpers)
#define VAR_IFACE_ICVAR                    icvar                    // Must use (ICvar)
#define VAR_IFACE_SERVERGAMEDLL            servergamedll            // Must use (IServerGameDLL)
#define VAR_IFACE_FILESYSTEM            filesystem                // Must use (IFileSystem)
#define VAR_IFACE_GLOBALVARS            gpGlobals                // Must use (CGlobalVars)

#define VAR_IFACE_BOTMANAGER            botmanager                // Optional (IBotManager)
#define VAR_IFACE_VOICESERVER            voiceserver                // Optional (IVoiceServer)
#define VAR_IFACE_GAMEEVENTMANAGER        gameeventmanager        // Optional (IGameEventManager2)
#define VAR_IFACE_EFFECTS                effects                    // Optional (IEffects)
#define VAR_IFACE_ENGINETRACE            enginetrace                // Optional (IEngineTrace)
#define VAR_IFACE_SERVERGAMEENTS        serverents                // Optional (IServerGameEnts) [GetEntityFromBaseEntity]
#define VAR_IFACE_SERVERCLIENTS            serverclients            // Optional (IServerGameClients) [GetPlayerStatefromEdict, metamod plugin hooks]
#define VAR_IFACE_RANDOMSTREAM            randomStr                // Optional (IUniformRandomStream) [GetEntityOfRandPlayer and GetIndexOfRandPlayer]
#define VAR_IFACE_SOUNDS                esounds                    // Optional (IEngineSound) [EmitSound, PrecacheSound]
#define VAR_IFACE_NETWORKSTRINGTABLE    networkstringtable        // Optional (NetworkStringTableContainer) [Downloads]


//=================================================================================
// Short and nice typed re-defenitions from interfaces variables
// You can change define name to your prefered name
// v = var, i = interface
//=================================================================================

#define viEngine                        VAR_IFACE_ENGINE
#define viPlayerinfomanager                VAR_IFACE_PLAYERINFOMANAGER
#define viHelpers                        VAR_IFACE_SERVERPLUGINHELPERS
#define viICvar                            VAR_IFACE_ICVAR
#define viServerdll                        VAR_IFACE_SERVERGAMEDLL
#define viFilesystem                    VAR_IFACE_FILESYSTEM
#define viGlobals                        VAR_IFACE_GLOBALVARS

#define viBotmanager                    VAR_IFACE_BOTMANAGER
#define viVoiceserver                    VAR_IFACE_VOICESERVER
#define viGameeventmanager                VAR_IFACE_GAMEEVENTMANAGER
#define viEffects                        VAR_IFACE_EFFECTS
#define viEnginetrace                    VAR_IFACE_ENGINETRACE
#define viServerclients                    VAR_IFACE_SERVERGAMEENTS
#define viRandomStr                        VAR_IFACE_RANDOMSTREAM
#define viEsounds                        VAR_IFACE_SOUNDS
#define viNetworkstringtable            VAR_IFACE_NETWORKSTRINGTABLE 
http://www.youtube.com/watch?v=1vHRMeRszw4
__________________
FaTony is offline
sn4k3
Senior Member
Join Date: Nov 2005
Old 01-27-2011 , 06:56   Re: undefined symbol from my own plugin
Reply With Quote #20

maybe you guys are not understanding

you still can use engine->
i use that defines for compability in my classes, because its a plugintemplate and people can rename variables

pratical example:

people dont want use engine, so rename to, cEngine

when renaming variables all plugin classes using engine will broke, so that way we keep customization and things keep working, with rename feature ...

anyway if want to check: http://code.google.com/p/sourcesdk-plugintemplate/
sn4k3 is offline
Send a message via MSN to sn4k3
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 02:09.


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