A
Angus Comber
Hello
I have a function which I have defined in a .h file called LogError. I use
a sort of global .h file which is included in all cpp files - StdAfx.h -
this file #include's my .h file with this function LogError.
In my program I have several .c/.h files. If I use LogError in just one of
these .c files all is well. However, if I use LogError in two or more .c
files, then I get this sort of link error:
error LNK2005: "int __cdecl LogError(char * const)" (?LogError@@YAHQAD@Z)
already defined in Page3.obj
I had a go at putting - extern int LogError(TCHAR szErrorMsg[]) in stdafx.h
and even some other files - but that did not seem to help.
How can I resolve this?
Angus Comber
(e-mail address removed)
I have a function which I have defined in a .h file called LogError. I use
a sort of global .h file which is included in all cpp files - StdAfx.h -
this file #include's my .h file with this function LogError.
In my program I have several .c/.h files. If I use LogError in just one of
these .c files all is well. However, if I use LogError in two or more .c
files, then I get this sort of link error:
error LNK2005: "int __cdecl LogError(char * const)" (?LogError@@YAHQAD@Z)
already defined in Page3.obj
I had a go at putting - extern int LogError(TCHAR szErrorMsg[]) in stdafx.h
and even some other files - but that did not seem to help.
How can I resolve this?
Angus Comber
(e-mail address removed)