xperious Asked:2020-12-15 17:08:27 +0000 UTC2020-12-15 17:08:27 +0000 UTC 2020-12-15 17:08:27 +0000 UTC 使用来自 linux.so 的函数 772 动态链接 .so 库。我找不到如何使用构建此库的 .cpp 文件的功能。 c++ 1 个回答 Voted Best Answer Rikitikitavi 2020-12-15T17:15:21Z2020-12-15T17:15:21Z 或多或少像这样: void* handle = dlopen(path.c_str(), RTLD_LAZY); if (!handle) const char* err = dlerror(); pfunc func = (pfunc)dlsym(handle, "func"); func() dlclose(handle);
或多或少像这样: