ROS .so载入undefined reference to `dlopen'问题
来源:互联网 发布:淘宝运营工资待遇 编辑:程序博客网 时间:2024/05/17 22:13
在ros下做libpcan导入是遇到`dlopen',`dlclose'等函数没有定义问题,查了好多资料,并没有解决,在google上搜索cmake dlopen后第一条就是解决方案。原文如下。
Suppose you get this error with the main.cpp
file below:
Linking CXX executable testlink CMakeFiles/testlink.dir/main.cpp.o: In function `main': main.cpp:(.text+0x1a): undefined reference to `dlopen' main.cpp:(.text+0x2a): undefined reference to `dlclose' collect2: ld returned 1 exit status make[2]: *** [testlink] Error 1 make[1]: *** [CMakeFiles/testlink.dir/all] Error 2 make: *** [all] Error 2
All you need to do is add ${CMAKE_DL_LIBS}
to the target_link_libraries()
call:
target_link_libraries(testlink ${CMAKE_DL_LIBS})
将testlink换成你的源码名称即可,添加在包的CMakeList.txt,就是添加add_executabla(源码名 src/源码名.cpp)的位置
0 0
- ROS .so载入undefined reference to `dlopen'问题
- ../thelib/libthelib.so: undefined reference to `dlopen'
- undefined reference to 'dlopen'
- undefined reference to 'dlopen';undefined reference to 'dlclose';undefined reference to 'dlerror'等问题
- linux g++ undefined reference to `dlopen'类问题
- libopencv_gpu.so.2.4: undefined reference to 问题
- undefined reference to dlopen, dlclose, dlsym and
- undefined reference to `dlclose' `dlopen' `dlsym'
- undefined reference to `dlclose' `dlopen' `dlsym'
- undefined reference to `dlopen'
- undefined reference to `dlopen'错误解决
- CodeBlocks Linux下调用dlopen undefined reference to dlopen 错误
- libstdc++.so:undefined reference to 'sqrt'、'asin'、'log'编译问题
- Linux c++ error: undefined reference to 'dlopen' 解决办法
- 编译错误undefined reference to `dlopen' 'dlsym' 'dlclose'的解决方法
- libxml2.so.2: undefined reference to `gzopen64'
- /lib/libQtGui.so: undefined reference to `ts_read_raw'
- libQtCore.so: undefined reference to `clock_gettime'
- 语音识别,自然语言处理的价值正被弱化?
- HDFS文件操作FileSystem使用API报错:copyToLocalFile NullPointerException
- 编写Java程序分析字符串中每个单词的个数
- 获取当前路径下的所有文件(子文件)
- [廖雪峰 - Python2.7教程] 返回函数2 - 学习笔记
- ROS .so载入undefined reference to `dlopen'问题
- 容斥原理(模板)
- 读[编程之法:面试与算法心得](字符处理)
- 关于实现了接口BeanPostProcessor 和 接口FactoryBean 的注意事项
- Android获取视频音频的时长的方法
- Tomcat设置默认启动项目
- 递归删除目录
- [java学习笔记]计算器dijkstra two-stack
- java 简述类的封装性、继承性、多态性