Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

| >>>>> "Asger" == Asger K Alstrup Nielsen <[EMAIL PROTECTED]> writes:
| 
| >> To me, these definitions look compatible... Could someone enlighten
| >> me on the reason why cxx think they are not compatible? Should we
| >> add a typecast here?
| 
| Asger> The only clue I could give is that it might be a C versus C++
| Asger> thing... Maybe cxx considers C functions incompatible with C++
| Asger> functions?
| 
| Asger> In that case, an extern "C" declaration might help...
| 
| Yes, it was indeed the problem. Now what I want to do is define a
| function to be both extern "C" and friend to a class. I don't seem to
| be able to do it...

Did you try this trick:

extern "C" int foo(int i);

class Bar {
        ...
        frient int foo(int i);
        ...
};

int foo(int i) {
        ...
}

        Lgb

Reply via email to