A
ankitjain.bvcoe
I have an existing C++ library . Now i am another application using
this C++ lib.
The problem here is i want to call C++ fn. from C file .If i use an
extern "C"declaration for that fn. then the original calls to this fn
creates error . eg
tobeused.cc
writtenincpp(int i ,char c)
{
}
---------
Now this fun writtenincpp() is being called from other C++ files in the
library.The compiler here does name mangling so other calls are
resolved (from c++ files)
But I want to call this fn. from a C file . so if i use
tobeused.cc
extern "C" void writtenincpp(int ,char)
writtenincpp(int i,char c)
{
}
----------------
The compiler now does not perform name mangling and this can now be
called successfully from C file .But the other refrences through C++
files generates an error.
So ,is there any means usingwhich i can have a fn. written in C++ file
which can be called from any C or C++ files (without changing anything
in other C++ files)
regards,
ankit
this C++ lib.
The problem here is i want to call C++ fn. from C file .If i use an
extern "C"declaration for that fn. then the original calls to this fn
creates error . eg
tobeused.cc
writtenincpp(int i ,char c)
{
}
---------
Now this fun writtenincpp() is being called from other C++ files in the
library.The compiler here does name mangling so other calls are
resolved (from c++ files)
But I want to call this fn. from a C file . so if i use
tobeused.cc
extern "C" void writtenincpp(int ,char)
writtenincpp(int i,char c)
{
}
----------------
The compiler now does not perform name mangling and this can now be
called successfully from C file .But the other refrences through C++
files generates an error.
So ,is there any means usingwhich i can have a fn. written in C++ file
which can be called from any C or C++ files (without changing anything
in other C++ files)
regards,
ankit