D
Dhillon
Hello All,
I have searched internet and also posts on this group. None of the
suggestions have worked in my case.
I am having linker issues when I try to use a C funtion in C++ code.
Though I have declared that C function as extern "C" c_func(......)
in my .cpp file.
Also this c_func takes argument as (void*, void (cpp_func*)(int,
void*, unsigned long), void*)
Here cpp_func is a pointer to a function in my .cpp file(not a member
function) where I am calling this c_func
To avoid name mangling by C++ compiler for the function to which
cpp_func points to I have also declared this
functions as extren "C" cpp_function_pointed_to (....) in my .h file
so that c_func is able to use this callback function which is defined
in my C++ file.
Please correct me where I am going wrong.
Despite doing all this, When I try to build my project I fail at
linker stage where linker complians about undefined funtion c_func
referred from function_pointed_by defined in my .cpp file
I am using CodeWarrior IDE for my development.
Thanks in advance,
MD
I have searched internet and also posts on this group. None of the
suggestions have worked in my case.
I am having linker issues when I try to use a C funtion in C++ code.
Though I have declared that C function as extern "C" c_func(......)
in my .cpp file.
Also this c_func takes argument as (void*, void (cpp_func*)(int,
void*, unsigned long), void*)
Here cpp_func is a pointer to a function in my .cpp file(not a member
function) where I am calling this c_func
To avoid name mangling by C++ compiler for the function to which
cpp_func points to I have also declared this
functions as extren "C" cpp_function_pointed_to (....) in my .h file
so that c_func is able to use this callback function which is defined
in my C++ file.
Please correct me where I am going wrong.
Despite doing all this, When I try to build my project I fail at
linker stage where linker complians about undefined funtion c_func
referred from function_pointed_by defined in my .cpp file
I am using CodeWarrior IDE for my development.
Thanks in advance,
MD