Libraries have been installed in: /usr/local/lib

编译一个程序,
./configure
make
两步都通过了,make install 报错

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'

请问,如何处理?

阅读 15.5k
3 个回答

哪里有报错?

这是告诉你接下来要怎么用。简单的办法是在 /etc/ld.so.conf.d 下新建一个文件 local.conf,里边写上 /usr/local/lib。然后以 root 权限执行 ldconfig。这样你的系统才会找得到安装到 /usr/local/lib 下的库文件。

这个不是错误。但是如果忽略的话,很可能白装了。
一般Linux系统缺省不会去/usr/local/lib找库文件。所以才有上面的警告。除了把该路径加入ldconfig之外,另外一个办法是用

./configure --prefix=/usr

来指定安装到缺省路径。(有个风险:别覆盖了系统原有的东西)

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏