我正在尝试编译 Donald EaSTLake 的 RFC 3797 随机选择算法的实现(代码:http://kambing.ui.ac.id/minix/other/rfc3797/)。但是,我收到链接器错误:
rfc3797.c:(.text+0xe7f): undefined reference to `log'
我正在尝试使用提供的 Makefile 来实现它,它明确链接到数学库,但我仍然收到错误:
cc -lm -o randomselection rfc3797.c MD5.c
如何编译这个程序?
最佳答案
我不知道是什么原因,但是如果你把-lm
移到最后,它会编译。
$ 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]
关于c - 对 `log' 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9145264/