undefined reference to涉及的链接问题
来源:互联网 发布:java项目经验范文 编辑:程序博客网 时间:2024/05/13 20:27
在linux下,编译链接的时候,经常会遇到这样一个问题,undefined reference to.....,引起这个问题的原因在于在链接的时候缺少选项。下面举几个例子,并给出解决办法。
1、undefined reference to `dlerror'
undefined reference to `dlopen'
undefined reference to `dlerror'
解决办法:在makefile的LDFLAGS后面把选项 -ldl 添加上即可。
2、undefined reference to `main'
解决办法:在makefile的LDFLAGS后面添加 -nostartfiles 选项。
3、undefined reference to `pthread_setspecific'
undefined reference to `pthread_key_delete'
undefined reference to `pthread_key_create'
解决办法:在makefile的LDFLAGS后面添加 -lpthread 选项。
4、undefined reference to `clock_gettime'
解决办法:在makefile的LDFLAGS后面添加 -lrt 选项。
不过要注意的是,如果undefined reference to后面的内容是在自己的文件中声明或定义的东西,就不能用这种方法来解决了。这时就需要检查一下自己的makefile涉及到源文件、头文件的地方是否出错了,也有可能是其他的原因。
- undefined reference to涉及的链接问题
- undefined reference to涉及的链接问题
- undefined reference to涉及的链接问题
- undefined reference to涉及的链接问题
- undefined reference to涉及的链接问题
- undefined reference to涉及的链接问题
- 嵌入式 常见的undefined reference to涉及的链接问题
- 编译:undefined reference to涉及的链接问题
- 链接库时的“undefined reference to”
- undefined reference to 链接错误
- undefined reference to `__ctype_b_loc' 的问题
- 解决undefined reference to `log' 的问题
- 解决undefined reference to `pthread_create'的问题
- 问题“undefined reference to `android_log_print”的解决办法
- undefined reference to xxx'的问题
- linux 链接库文件出现“undefined reference to" 问题的解决方法
- 关于在Mingw下链接时抛出undefined reference to `XXX'异常的问题
- linux 链接库文件出现“undefined reference to" 问题的解决方法
- Android程序有很多Activity,在B中如何关闭整个Android应用程序,关闭所有的 Activity
- JDBC连接MYSQL
- dataGridview 定位行(在有下拉条的时候定位到某一行)
- ZOJ3031
- 全球排名前50网站都用什么语言开发的?
- undefined reference to涉及的链接问题
- c++ 防止隐式转换 explicit
- 脑成像数据的格式转换
- ubuntu下 matlab安装和开启
- stm32系统时钟详解&&移植
- SQL连接查询语句
- mysql-noinstall.zip免安装版的优化配置和精简
- Ajax跨域查询完美解决方案
- DLL注入技术之REG注入