"Ben Bacarisse" <ben.usenet@[EMAIL PROTECTED]
> wrote in message
news:87wsj75jaf.fsf@[EMAIL PROTECTED]
> "Jeff Baker" <algorthjb@[EMAIL PROTECTED]
> writes:
>
>> I have two cl***** with two headers respectively and a single header,
>> just
>> function, that both Implementation Method uses.
>> One header with Implementation Method alone with the function header
>> works
>> fine. I test both cl***** alone and they work.
>
> So you have:
>
> a.h: b.h:
>
> class A { class B {
> ... ...
> }; };
>
> and a file f.h that is supposed to declare some functions used by
> both:
>
> a.cc: b.cc:
>
> #include "a.h" #include "b.h"
> #include "f.h" #include "f.h"
>
>> Combining them I get: Wieghts and Measures 7.25.08 error LNK2005:
"void
>> __cdecl clrscr(int,int,int,int,int)" (?clrscr@[EMAIL PROTECTED]
) already
>> defined
>> in Grams_Method.obj
>> The link error refers to the header that is function that both cl*****
>> use.
>> This function header is only included in the Implementation Methods.
>
> If I've got that right, then it looks like f.h defines rather than
> declares clrscr. One way or another there are two copies of the
> definition of the function.
>
> If this is not enough to sort it out, cut down the code as much as you
> can (without losing the error, of course) and post it.
I found that /FORCE works giving just a warning. What it does is /FORCE
only one copy to be used with the other copie(s) being ignored. Gives a
LNK4006 warning.
I am thinking of writting a class for the function header and embed the
objects to access the functions. Right now /FORCE works.
Jeff


|