[Solved]Visual Studio Linker Error
Posted: Sat Aug 01, 2009 11:53 am
Hey Guys,
So I recently started putting together a new project in Visual Studio 2008. I am getting a linker error when I try to build telling me that some of my globals are already defined. I've used this same process before but for some reason it doesn't seem to be working any more. Here is the error...
All referencing items in my globals.h file. A timer class, screen surface, and event structure. I recently switched from Visual c++ Express to Visual Studio 2008 Professional so I'm not sure if maybe my project options are causing this. I'm guessing not though. I must have something coded wrong. At first I thought I might have my #ifndefs setup wrong but each header file has them. Any thoughts?
So I recently started putting together a new project in Visual Studio 2008. I am getting a linker error when I try to build telling me that some of my globals are already defined. I've used this same process before but for some reason it doesn't seem to be working any more. Here is the error...
Code: Select all
error LNK2005: "struct SDL_Surface * screen" (?screen@@3PAUSDL_Surface@@A) already defined in functions.obj
error LNK2005: "union SDL_Event event" (?event@@3TSDL_Event@@A) already defined in functions.obj
error LNK2005: "class Timer timer1" (?timer1@@3VTimer@@A) already defined in functions.obj
error LNK2005: "struct SDL_Surface * screen" (?screen@@3PAUSDL_Surface@@A) already defined in functions.obj
error LNK2005: "union SDL_Event event" (?event@@3TSDL_Event@@A) already defined in functions.obj
error LNK2005: "class Timer timer1" (?timer1@@3VTimer@@A) already defined in functions.obj
error LNK2005: "struct SDL_Surface * screen" (?screen@@3PAUSDL_Surface@@A) already defined in functions.obj
error LNK2005: "union SDL_Event event" (?event@@3TSDL_Event@@A) already defined in functions.obj
error LNK2005: "class Timer timer1" (?timer1@@3VTimer@@A) already defined in functions.obj
All referencing items in my globals.h file. A timer class, screen surface, and event structure. I recently switched from Visual c++ Express to Visual Studio 2008 Professional so I'm not sure if maybe my project options are causing this. I'm guessing not though. I must have something coded wrong. At first I thought I might have my #ifndefs setup wrong but each header file has them. Any thoughts?