migration from vs2003 to vs2010 errors

hello,
i've converted my solution from vs2003 to vs2010 im getting some linker errors
-> Error 93 error LNK2005: _UnhandledExceptionFilter@4 already defined in MonitorTmCMD.obj
-> Error 94 error LNK1169: one or more multiply defined symbols found
im using this function => LONG WINAPI UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *lpTopLevelExceptionFilter) it works fine in old version of vs but in vs2010 it doesnt when i comment the above function in vs2010 it works fine can some one tell me whats the exact problem ?
probably some dependencies changes in later vs2010 libs. Each cpp file is compiled in object file, and linker is connecting all of these together into executable. Your problem is that UnhandledExceptionFilter is defined twice and linker dont know which to choose. According to http://msdn.microsoft.com/en-us/library/windows/desktop/ms681401%28v=vs.85%29.aspx UnhandledExceptionFilter definition is in WinBase.h (include Windows.h). What includes are in your cpp file where you use this function? You might use preprocessor guard http://www.cprogramming.com/reference/preprocessor/ifndef.html in your header.
Topic archived. No new replies allowed.