[英]invalid conversion from ‘void*’ to ‘int (*)(std::vector<deptrum::DeviceInformation>&)’
when I run this code, it goes wrong.当我运行这段代码时,它出错了。
void* triangle = dlopen("../lib/libdeptrum_tof.so", RTLD_LAZY);
std::vector<deptrum::DeviceInformation> device_list;
int (*GetDeviceList) (std::vector<deptrum::DeviceInformation>& device_list);
GetDeviceList = dlsym(triangle,"GetDeviceList");
Thank you for your help!!谢谢您的帮助!!
You need to use auto f = reinterpret_cast<YourFunctionType*>(dlsym(…));
您需要使用
auto f = reinterpret_cast<YourFunctionType*>(dlsym(…));
. .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.