我正在使用autotools来配置和构建使用dlopen及其朋友的项目。
我有下面的代码片段在我的根configure.ac
:
AC_SEARCH_LIBS([dlopen], [dl dld], [], [ AC_MSG_ERROR([unable to find the dlopen() function]) ])
这是我从https://autotools.io/autoconf/finding.html
了该库是通过自动工具发现:
checking for library containing dlopen... -ldl
但是,图书馆似乎没有被添加到$(LIBS)
因为:
a_out_LDADD=-ldl
工程(即项目编译并运行),并
a_out_LDADD=$(LIBS)
不(即undefined reference to 'dlopen'
)
我缺少什么?