[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: converting C to C++ : linkng problems



Joris Huizer wrote:
That makes sence, but still - it's exactly the same code as used in C and the C code compiles fine (except for some added casts as C++ doesn't like coercing void pointers to something else) if I do an objdump it seems those functions that are not found have been mangled by C++

C is not C++
C is not a subset of C++
They are different languages
There is a subset of C++ which resembles C very closely

One common error is to compile C with a C compiler (or
a C++ compiler in "C Mode") and then try to link it
with C++ compiled with a C++ compiler. This won't work.

Your C routines must be compiled with a C++ compiler
IN C++ MODE, or they must be declared as extern C {...}
otherwise you'll get linking problems.

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!



Reply to: