未定义的引用'登录' [英] undefined reference to `log'

查看:114
本文介绍了未定义的引用'登录'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译由唐纳德·东湖(code中的RFC 3797随机选择算法的实现:<一href=\"http://kambing.ui.ac.id/minix/other/rfc3797/\">http://kambing.ui.ac.id/minix/other/rfc3797/).不过,我得到一个链接器错误:

I am trying to compile the implementation of the RFC 3797 random selection algorithm by Donald Eastlake (code: http://kambing.ui.ac.id/minix/other/rfc3797/). However, I am getting a linker error:

rfc3797.c:(.text+0xe7f): undefined reference to `log'

我想与所提供的Makefile文件,其中明确对数学libraray链接,使,但我仍然得到错误:

I am trying to make it with the provided Makefile, which explicitly links against the math libraray, but I still get the error:

cc -lm -o randomselection rfc3797.c MD5.c

我怎么能编译这个程序?

How can I compile this program?

推荐答案

我不知道原因是什么,但如果移动 -lm 来结束,它会编译。

I don't know what the reason is, but if you move -lm to the end, it will compile.

$ cc -o randomselection rfc3797.c MD5.c -lm
rfc3797.c: In function ‘getinteger’:
rfc3797.c:183:3: warning: format not a string literal and no format arguments [-Wformat-security]

这篇关于未定义的引用'登录'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆