Hello, I’m trying to add a console command through C++ in a GMOD Module. The code goes something like this.
CreateInterfaceFn VSTDLibFactory = Sys_GetFactory("vstdlib.dll"); cvar = ( ICvar* )VSTDLibFactory( CVAR_INTERFACE_VERSION, NULL ); cvar->RegisterConCommand(new ConCommand ( "test_concmd", concmd_f, "Test Comcommand through c++", 0));
The problem is when I compile it I get an error like this:
1>tier1.lib(tier1.obj) : error LNK2005: _cvar already defined in gm_main.obj
I’ve got it linked against tier0.lib and tier1.lib, and included icvar.h and convar.h, and I haven’t edited any of the headers. Any Ideas how I can fix this?