Thanks man! m able to resolve the link issue.

Need to add extern "C" where ever c code is called from cpp file (this is
one of the many method).
http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html can help.

Thanks a lot.
Bye
Mallik

On 10/5/07, David <[EMAIL PROTECTED]> wrote:
>
>   pm rao a écrit :
> > Hi All,
> >
> > I'm trying with compiling a c program (say test.c) and a cpp program (
> > main.cpp).
> > I'm calling a c routine testFunc present in test.c from main.cpp.
> >
> > I'm able to compile the program using g++, but m getting undefined
> > references in main.cpp for the testFun routine.
> >
> > I have a round about solution by changing test.c to test.cpp. Then m
> able to
> > compile and link.
> >
> > But is there any way to compile the c code in c++ context??. Do we have
> any
> > compiler options/ preprocessor directives??
> >
>
> Hi,
> look for : extern "C"
> on google.
>
> Regards,
> David
>  
>


[Non-text portions of this message have been removed]

Reply via email to