1. 如未安装libcrypt,编译./configure时会报错:checking for libmcrypt - version >= 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found
解决方法:
1. 安装limcrypt。 ./configure && make && make install
2. 在/etc/ld.so.conf.d/中新增文件:libmcrypt.conf。内容为libmcrypt安装后的提示的lib安装路径,默认为/usr/local/lib/
# cat /etc/ld.so.conf.d/libmcrypt.conf
/usr/local/lib/
3. 配置完成后使用命令 ldconfig使配置生效,再次运行./configure
附:libmcrypt 安装后的提示:
/usr/bin/install -c .libs/libmcrypt.lai /usr/local/lib/libmcrypt.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
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'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
2. 如没有安装libmash, 编译mcrypt时会有如下提示:
configure: error: "You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/"
libmhash需要安装mhash。mhash的默认安装位置也是/ur/local/lib/。如果没有在ld.so.conf中指定,需要按libmrypt的方法进行配置,如果已经在ld.so.conf中配置so的路径。只需要再次执行ldconfig即可。