K, so here's the rub. I'm trying to essentially turn cgDC/uiInfo.uiDC into a namespace, as opposed to being a giant glob of function pointers. The definition for the namespace functions is held in ui_devicecontext.cpp, which is included by both cgame and game. The namespace is declared within ui_devicecontext.h, which is included by all the files which make use of the namespace. Here's the code: http://slexy.org/raw/s209ji5Xoe Anyway...yeah, the problem is that the linker barfs over this.
Error 4 error LNK2005: "bool (__cdecl* DisplayContext::FeederSelection)(float,int,struct itemDef_s *)" (?FeederSelection@DisplayContext@@3P6A_NMHPAUitemDef_s@@@ZA) already defined in ui_atoms.obj E:\Code Projects\Github\JKGDevs\OpenJK\codemp\ui\ui_devicecontext.obj
Error 48 error LNK2005: "bool (__cdecl* DisplayContext::FeederSelection)(float,int,struct itemDef_s *)" (?FeederSelection@DisplayContext@@3P6A_NMHPAUitemDef_s@@@ZA) already defined in ui_atoms.obj E:\Code Projects\Github\JKGDevs\OpenJK\codemp\ui\ui_main.obj
Error 92 error LNK2005: "bool (__cdecl* DisplayContext::FeederSelection)(float,int,struct itemDef_s *)" (?FeederSelection@DisplayContext@@3P6A_NMHPAUitemDef_s@@@ZA) already defined in ui_atoms.obj E:\Code Projects\Github\JKGDevs\OpenJK\codemp\ui\ui_saber.obj
ad nauseum for each function call btw, I'm calling them like this:
DisplayContext::FeederSelection(blah, blah, blah);