2., 3.}; double y[] = {4., -5., 6.}; auto lib = ::dlopen("./librepromath.so", RTLD_LOCAL | RTLD_NOW); /* ...处理错误 */ typedef auto ddot_t(int, double const *, double const *) -> double; auto ddot = (ddot_t *)::dlsym(lib, "_ZN9repromath4ddotEiPKdS1_"); printf("result = %g\n", ddot(3, x, y)); ::dlclose(lib); POSIX 下的例子