Re: compiling c code but libraries are compiled in c++



On 29 May 2007 04:11:14 -0700 sumit <sumit.shrivastava09@xxxxxxxxx> wrote:

| We have written cunit code for testing some APIs. defination of
| those APIs are in c++ and .so library is created of them. when I
| compile my cunit code it gets compiled successfully but while liking
| it gives undefined reference to symbol. can anyone help me in this
| matter.

C++ mangles the symbols so it can enforce function argument type matching
at linking time. You will need to find out how they are mangled and use
those same names in C. Or change the C++ programs to define the functions
as special C type.

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2007-05-29-0654@xxxxxxxx |
|------------------------------------/-------------------------------------|
.