2013七月21
CMake–解决undefined reference to `dlopen'(linux链接参数)
linux shell下使用man dlopen查看定义
#include void *dlopen(const char *filename, int flag); char *dlerror(void); void *dlsym(void *handle, const char *symbol); int dlclose(void *handle); Link with -ldl.
头文件包含了,还差link,在CMKAE中声明(主makelists或exe的makelist中):
#设置链接库 if(WIN32) else() set(CMAKE_EXE_LINKER_FLAGS "-ldl") endif()
文章作者:hgy413
本文地址:https://hgy413.com/2191.html
版权所有 © 转载时必须以链接形式注明作者和原始出处!