Hi,

I need to use ancient C routine in a C++ .NET Class lib,
so that the code becomes accessable in a .NET application.

I keep getting a name mangling problem on some functions:
Calculator error LNK2001: unresolved external
symbol "double __cdecl cos(double)" (?cos@@$$J0YANN@Z)

Can anybody tell me how I can get this app going???

Tanx, Hans

Re: Ancient C routines in C++ .NET Class Lib by Igor

Igor
Fri Nov 21 11:17:17 CST 2003

"Hans" <anonymous@discussions.microsoft.com> wrote in message
news:094701c3b00b$1e1aaf60$a101280a@phx.gbl...
> I need to use ancient C routine in a C++ .NET Class lib,
> so that the code becomes accessable in a .NET application.
>
> I keep getting a name mangling problem on some functions:
> Calculator error LNK2001: unresolved external
> symbol "double __cdecl cos(double)" (?cos@@$$J0YANN@Z)

Declare those C functions as extern "C" - this removes name mangling.
E.g. you can do something like this:

extern "C"
{
#include "OldCHeader.h"
}

--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken