Actually there's no need to modify cpp source file, but we still need to slightly modify header file very little bit.
Combined knowledge of C/C++ linkage to C++ library to produce C linkage so that C source file can call functions properly. Check symbol table dumped via objdump -t ...
.
As well the technique to directly use .dylib
file to solve -l
issue ("lib" prefix) is good.