Closed sidwarkd closed 8 months ago
This is happening because of C++ vs C linkage. You can wrap your fake definitions in extern "C" { ... }
.
@paleozogt Unfortunately I can't easily get back into a state to test this but it feels like it will be the correct answer. I didn't even think about extern "C"-ing things. I'm going to close the issue and if I get back to this state and that doesn't resolve it I will re-open. Thanks for your help.
Describe the bug I have an embedded project and am trying to follow the pattern in the weak linking example. I'm able to get my tests to run with FFF fakes including things like custom_fake, call_count, etc but I can't reset the fakes. Whenever I add a call to
RESET_FAKE
my test program fails to link with the errors:When I run
nm
on one of the object files that goes into my libfakes library I see the following output:As you can see, most of the FFF generated functions have clean names but all of the reset functions are mangled. Is this an issue with FFF or how I am generating my libfakes library in CMake? Due to the embedded nature of the project there is a mix of C and C++ code involved.
Compiler, toolset, platform (please complete the following information):