How to compile a cpp and then link it to a shared library
问题 I want to have the functions which are defined in another .cpp file become available in another simulation tool. I found the following code in this question: -finstrument-functions doesn't work with dynamically loaded g++ shared objects (.so) Trace.cpp #include <stdio.h> #ifdef __cplusplus extern "C" { void __cyg_profile_func_enter(void *this_fn, void *call_site) __attribute__((no_instrument_function)); void __cyg_profile_func_exit(void *this_fn, void *call_site) __attribute__((no_instrument