use C api as dynamically loaded calls in C++