1 2 3 4 5 6 7 8 9 10 11
#include <memory> #include "mylib.h" extern "C" { DO_EXPORT int foo(void); } int foo(void) { auto bptr = std::make_shared<int>(0); return *bptr; }