Why does autoconf erroneously find a function which isn't available later?

前端 未结 1 878
悲&欢浪女
悲&欢浪女 2021-01-25 02:34

On a Linux system I configured a software package (llvm) and autoconf finds the arc4random function. Here an extraction of the output during configuration:

相关标签:
1条回答
  • 2021-01-25 02:52

    According to arc4random(3), to use this function, you should include <bsd/stdlib.h> in your code and link it with -lbsd.

    What this AC_CHECK_FUNCS([... arc4random ]) does is to make sure arc4random exists in your system, then define the macro named HAVE_ARC4RANDOM, but it cannot guarantee your code is using it correctly.

    0 讨论(0)
提交回复
热议问题