zoukankan      html  css  js  c++  java
  • ubuntu安装gcc不同的版本

    服务器ubuntu14.04安装ns3.29中,显示gcc版本过低
    使用apt-get安装失败,ubuntu14.04默认安装gcc4.8.4,无法下载更高级的gcc版本

    先找到资料1,脚本尝试了,下载不了gcc-6
    再尝试源码安装gcc,找到资料2,手动安装gcc的依赖包和gcc,发现其中的mpfr包的博客中的版本下载不到,新版本尝试下,对之后的步骤有影响导致最后一个依赖包下载失败,不过这个博客中有gcc各种版本的下载源比较有用,在此贴出:下载源1(使用过),下载源2
    最后找到一个博客,里面有个脚本直接下载编译所需要的依赖项,尝试并成功,资料3
    编译完成后,出现:

    ----------------------------------------------------------------------
    Libraries have been installed in:
       /usr/local/lib/../lib64
    
    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.
    

    这是告诉你接下来要怎么用。简单的办法是在 /etc/ld.so.conf.d 下新建一个文件 local.conf,里边写上 /usr/local/lib。然后以 root 权限执行 ldconfig。这样你的系统才会找得到安装到 /usr/local/lib 下的库文件
    一般Linux系统缺省不会去/usr/local/lib找库文件。所以才有上面的警告。除了把该路径加入ldconfig之外,另外一个办法是用

    ./configure --prefix=/usr
    

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

  • 相关阅读:
    网络安全之数字签名
    python爬取并分析淘宝商品信息
    循环与分支——python
    线性相关与线性无关
    linux之文件传输协议(FTP)与本地用户测试
    递归下降语法分析
    MySQL:索引
    一个基础又很重要的知识点:JDBC原理(基本案例和面试知识点)
    Tomcat的部署、虚拟主机及优化
    二叉树深度
  • 原文地址:https://www.cnblogs.com/baizihua/p/11862028.html
Copyright © 2011-2022 走看看