V
Vikram
* i have a file foo.cpp ; it has a single function called
"call_me(char*)". the function does some stuff and uses some other large
libraries written in C++.
* i also have bar.c ; i need to call this single function [call_me] from
the bar.c code. bar.c is a part of a large C code base.
how do i do this ? as far as i understand i did the following:
1) extern "C" {void call_me(char*);} for the header foo.h and then
included foo.h in bar.c.
2) then i compiled foo.cpp into foo.o using g++ - this works
3) then i compiled bar.c and foo.o using gcc but i get a ton of errors at
this stage. all relating to c++ stl stuff. what is wrong here ?
and in general what is the correct/easy way of mixing C and C++ code -
ideally i would like to call functions from both sides into the other.
hope i was clear. thanks
"call_me(char*)". the function does some stuff and uses some other large
libraries written in C++.
* i also have bar.c ; i need to call this single function [call_me] from
the bar.c code. bar.c is a part of a large C code base.
how do i do this ? as far as i understand i did the following:
1) extern "C" {void call_me(char*);} for the header foo.h and then
included foo.h in bar.c.
2) then i compiled foo.cpp into foo.o using g++ - this works
3) then i compiled bar.c and foo.o using gcc but i get a ton of errors at
this stage. all relating to c++ stl stuff. what is wrong here ?
and in general what is the correct/easy way of mixing C and C++ code -
ideally i would like to call functions from both sides into the other.
hope i was clear. thanks