2016-07-27 206 views
1

我想在亚马逊linux ec2实例上安装opendkim。从源编译时,我得到: 配置:错误:没有strlcpy/strlcat发现 所以我从源码安装了libbsd。一旦安装,我可以去strlcat和strlcpy的手册页,但我无法访问这些功能。我验证了共享库已安装。该libbsd的输出侧设置规定使用的4个选项之一:链接到linux共享库

If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: 

    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable 
    during execution 
    - add LIBDIR to the `LD_RUN_PATH' environment variable 
    during linking 
    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag 
    - have your system administrator add LIBDIR to `/etc/ld.so.conf' 

我跑

export LD_RUN_PATH=/usr/local/lib 
export LD_LIBRARY_PATH=/usr/local/lib/ 

另外我/etc/ld.so.conf中含有

include ld.so.conf.d/*.conf 

和我的/etc/ld.so.conf.d/libbsd.conf包含

/usr/local/lib/libbsd 

最后检查我libbsd库纳米-D /usr/local/lib/libbsd.so包含:

000000000000de30 T strlcat 
000000000000ded0 T strlcpy 

所以我的问题怎么办,我不是,揭露strlcat提供和是strlcpy到命令行?或者我该怎么做“使用-Wl,-rpath -Wl,LIBDIR'链接器标志”选项,或者一般来说,我在链接到共享库时做了什么错误?任何帮助表示赞赏。谢谢!

回答

0

因此无法与库链接,但我能够解决依赖关系。来自centos的二进制rpm完美安装:

sudo wget http://dl.fedoraproject.org/pub/epel/7/x86_64/l/libbsd-0.6.0-3.el7.x86_64.rpm 
sudo yum localinstall ./libbsd-0.6.0-3.el7.x86_64.rpm 

sudo wget http://dl.fedoraproject.org/pub/epel/7/x86_64/l/libbsd-devel-0.6.0-3.el7.x86_64.rpm 
sudo yum localinstall ./libbsd-devel-0.6.0-3.el7.x86_64.rpm