You have to put
extern "C" {
};
enclosing your C++ functions, so they have C linkage.
The problem is that C++ mangles the function names to perform type safe
linking, because you can overload function names with diferent parameter
types.
> -----Mensaje original-----
> De: Luc Hermans [mailto:[EMAIL PROTECTED]]
> Enviado el: Miércoles 3 de Enero de 2001 11:40
> Para: [EMAIL PROTECTED]
> Asunto: linking c and cc sources
>
>
> Hi all,
>
> For my project I use cc (no object c++) source files
> eg. test.cc and want to link them with some other
> sources pub.c
>
> The problem is that global functions in test.cc
> are named test_fie__Fv()
> while pub.c calls test_fie() which results in
> a unresolved external at linking.
>
> I can solve this problem by adding the line to pub.c
> #define test_fie test_fie__Fv
>
> But I think there must be some cleaner way for
> this (compiler option ?).
> Any suggestions ?
>
> Thanks,
> Luc
>
--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.