请选择 进入手机版 | 继续访问电脑版

安装cmake:/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found

[复制链接]
查看1492 | 回复0 | 2019-7-3 15:43:14 | 显示全部楼层 |阅读模式
一、故障现象

安装cmake时,执行 ./bootstrap 命令时,报错:
/usr/local/cmake-3.14.0/Bootstrap.cmk/cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/cmake-3.14.0/Bootstrap.cmk/cmake)
/usr/local/cmake-3.14.0/Bootstrap.cmk/cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/local/cmake-3.14.0/Bootstrap.cmk/cmake)


二、解决方法

执行以下命令查看本机的GLIBCXX:
# strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
输出如下内容:
  1. GLIBCXX_3.4
  2. GLIBCXX_3.4.1
  3. GLIBCXX_3.4.2
  4. GLIBCXX_3.4.3
  5. GLIBCXX_3.4.4
  6. GLIBCXX_3.4.5
  7. GLIBCXX_3.4.6
  8. GLIBCXX_3.4.7
  9. GLIBCXX_3.4.8
  10. GLIBCXX_3.4.9
  11. GLIBCXX_3.4.10
  12. GLIBCXX_3.4.11
  13. GLIBCXX_3.4.12
  14. GLIBCXX_3.4.13
  15. GLIBCXX_3.4.14
  16. GLIBCXX_3.4.15
  17. GLIBCXX_3.4.16
  18. GLIBCXX_3.4.17
  19. GLIBCXX_3.4.18
  20. GLIBCXX_3.4.19
  21. GLIBCXX_DEBUG_MESSAGE_LENGTH
复制代码
可以看到,确实没有 GLIBCXX_3.4.20和 GLIBCXX_3.4.21。

使用以下命令查询  libstdc++.so.6 文件包含在哪个软件包中:
# yum provides libstdc++.so.6输出如下内容:
  1. libstdc++-4.8.5-36.el7.i686 : GNU Standard C++ Library
  2. 源    :base
  3. 匹配来源:
  4. 提供    :libstdc++.so.6

  5. libstdc++-4.8.5-36.el7_6.1.i686 : GNU Standard C++ Library
  6. 源    :updates
  7. 匹配来源:
  8. 提供    :libstdc++.so.6

  9. libstdc++-4.8.5-36.el7_6.2.i686 : GNU Standard C++ Library
  10. 源    :updates
  11. 匹配来源:
  12. 提供    :libstdc++.so.6

  13. libstdc++-4.8.5-36.el7_6.2.i686 : GNU Standard C++ Library
  14. 源    :@updates
  15. 匹配来源:
  16. 提供    :libstdc++.so.6
复制代码
可以看出,libstdc++-4.8.5-36.el7.i686、libstdc++-4.8.5-36.el7_6.1.i686、libstdc++-4.8.5-36.el7_6.2.i686、libstdc++-4.8.5-36.el7_6.2.i686 这几个包 包含了 libstdc++.so.6 文件

安装 libstdc++-4.8.5-36.el7.i686:
# yum -y install libstdc++-4.8.5-36.el7.i686

# cp /usr/local/lib64/libstdc++.so.6.0.21 /usr/lib64/
注:这里的 libstdc++.so.6.0.21 根据实际情况选择较新的版本。

# ll /usr/lib64/libstdc++.so.6
  1. lrwxrwxrwx. 1 root root 19 10月 30 2018 /usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.19
复制代码

# ll /usr/lib64/libstdc++.so.6.0.19
  1. -rwxr-xr-x. 1 root root 991616 4月  24 22:24 /usr/lib64/libstdc++.so.6.0.19
复制代码

# rm -f /usr/lib64/libstdc++.so.6
# cd /usr/lib64/
# ln libstdc++.so.6.0.21 libstdc++.so.6

再次查看本机的GLIBCXX:
#  strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
输出如下内容:
  1. GLIBCXX_3.4
  2. GLIBCXX_3.4.1
  3. GLIBCXX_3.4.2
  4. GLIBCXX_3.4.3
  5. GLIBCXX_3.4.4
  6. GLIBCXX_3.4.5
  7. GLIBCXX_3.4.6
  8. GLIBCXX_3.4.7
  9. GLIBCXX_3.4.8
  10. GLIBCXX_3.4.9
  11. GLIBCXX_3.4.10
  12. GLIBCXX_3.4.11
  13. GLIBCXX_3.4.12
  14. GLIBCXX_3.4.13
  15. GLIBCXX_3.4.14
  16. GLIBCXX_3.4.15
  17. GLIBCXX_3.4.16
  18. GLIBCXX_3.4.17
  19. GLIBCXX_3.4.18
  20. GLIBCXX_3.4.19
  21. GLIBCXX_3.4.20
  22. GLIBCXX_3.4.21
  23. GLIBCXX_DEBUG_MESSAGE_LENGTH
  24. <a href="mailto:_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv@GLIBCXX_3.4" target="_blank">_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv@GLIBCXX_3.4</a>
  25. _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv@@GLIBCXX_3.4.5
  26. <a href="mailto:_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw@GLIBCXX_3.4" target="_blank">_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw@GLIBCXX_3.4</a>
  27. _ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv@@GLIBCXX_3.4.5
  28. GLIBCXX_3.4.21
  29. GLIBCXX_3.4.5
  30. GLIBCXX_3.4.9
  31. _ZSt10adopt_lock@@GLIBCXX_3.4.11
  32. GLIBCXX_3.4.10
  33. GLIBCXX_3.4.16
  34. GLIBCXX_3.4.1
  35. <a href="mailto:_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv@GLIBCXX_3.4" target="_blank">_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv@GLIBCXX_3.4</a>
  36. <a href="mailto:_ZNSs7_M_copyEPcPKcm@GLIBCXX_3.4" target="_blank">_ZNSs7_M_copyEPcPKcm@GLIBCXX_3.4</a>
  37. _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv@@GLIBCXX_3.4.5
  38. _ZNSs7_M_moveEPcPKcm@@GLIBCXX_3.4.5
  39. <a href="mailto:_ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4" target="_blank">_ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4</a>
  40. <a href="mailto:_ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv@GLIBCXX_3.4" target="_blank">_ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv@GLIBCXX_3.4</a>
  41. _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEm@@GLIBCXX_3.4.5
  42. <a href="mailto:_ZNSs4_Rep26_M_set_length_and_sharableEm@GLIBCXX_3.4" target="_blank">_ZNSs4_Rep26_M_set_length_and_sharableEm@GLIBCXX_3.4</a>
  43. _ZSt10defer_lock@@GLIBCXX_3.4.11
  44. _ZN10__gnu_norm15_List_node_base4swapERS0_S1_@@GLIBCXX_3.4
  45. _ZNSs9_M_assignEPcmc@@GLIBCXX_3.4.5
  46. _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEmmPKc@@GLIBCXX_3.4.5
  47. _ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv@@GLIBCXX_3.4.5
  48. <a href="mailto:_ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwm@GLIBCXX_3.4" target="_blank">_ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwm@GLIBCXX_3.4</a>
  49. _ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order@@GLIBCXX_3.4.11
  50. GLIBCXX_3.4.20
  51. _ZNSt11char_traitsIwE2eqERKwS2_@@GLIBCXX_3.4.5
  52. GLIBCXX_3.4.12
  53. _ZNSi6ignoreEv@@GLIBCXX_3.4.5
  54. GLIBCXX_3.4.2
  55. _ZNSt11char_traitsIcE2eqERKcS2_@@GLIBCXX_3.4.5
  56. GLIBCXX_3.4.6
  57. GLIBCXX_3.4.15
  58. _ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv@@GLIBCXX_3.4.5
  59. <a href="mailto:_ZNSs9_M_assignEPcmc@GLIBCXX_3.4" target="_blank">_ZNSs9_M_assignEPcmc@GLIBCXX_3.4</a>
  60. GLIBCXX_3.4.19
  61. <a href="mailto:_ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4" target="_blank">_ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4</a>
  62. <a href="mailto:_ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv@GLIBCXX_3.4" target="_blank">_ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv@GLIBCXX_3.4</a>
  63. _ZN10__gnu_norm15_List_node_base7reverseEv@@GLIBCXX_3.4
  64. _ZN10__gnu_norm15_List_node_base4hookEPS0_@@GLIBCXX_3.4
  65. <a href="mailto:_ZNSt11char_traitsIwE2eqERKwS2_@GLIBCXX_3.4" target="_blank">_ZNSt11char_traitsIwE2eqERKwS2_@GLIBCXX_3.4</a>
  66. <a href="mailto:_ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwm@GLIBCXX_3.4" target="_blank">_ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwm@GLIBCXX_3.4</a>
  67. _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwm@@GLIBCXX_3.4.5
  68. GLIBCXX_3.4.11
  69. GLIBCXX_3.4.3
  70. GLIBCXX_3.4.7
  71. _ZNSi6ignoreEl@@GLIBCXX_3.4.5
  72. _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw@@GLIBCXX_3.4.5
  73. <a href="mailto:_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv@GLIBCXX_3.4" target="_blank">_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv@GLIBCXX_3.4</a>
  74. _ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv@@GLIBCXX_3.4.5
  75. GLIBCXX_3.4.14
  76. _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwm@@GLIBCXX_3.4.5
  77. GLIBCXX_3.4.18
  78. <a href="mailto:_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEm@GLIBCXX_3.4" target="_blank">_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEm@GLIBCXX_3.4</a>
  79. _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEl@@GLIBCXX_3.4.5
  80. _ZSt15future_category@@GLIBCXX_3.4.14
  81. <a href="mailto:_ZNSi6ignoreEl@GLIBCXX_3.4" target="_blank">_ZNSi6ignoreEl@GLIBCXX_3.4</a>
  82. GLIBCXX_3.4
  83. <a href="mailto:_ZNSt11char_traitsIcE2eqERKcS2_@GLIBCXX_3.4" target="_blank">_ZNSt11char_traitsIcE2eqERKcS2_@GLIBCXX_3.4</a>
  84. <a href="mailto:_ZNKSs15_M_check_lengthEmmPKc@GLIBCXX_3.4" target="_blank">_ZNKSs15_M_check_lengthEmmPKc@GLIBCXX_3.4</a>
  85. _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4
  86. <a href="mailto:_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwmw@GLIBCXX_3.4" target="_blank">_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwmw@GLIBCXX_3.4</a>
  87. _ZNVSt9__atomic011atomic_flag5clearESt12memory_order@@GLIBCXX_3.4.11
  88. _ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv@@GLIBCXX_3.4.5
  89. <a href="mailto:_ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv@GLIBCXX_3.4" target="_blank">_ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv@GLIBCXX_3.4</a>
  90. <a href="mailto:_ZNSs7_M_moveEPcPKcm@GLIBCXX_3.4" target="_blank">_ZNSs7_M_moveEPcPKcm@GLIBCXX_3.4</a>
  91. <a href="mailto:_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEl@GLIBCXX_3.4" target="_blank">_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEl@GLIBCXX_3.4</a>
  92. _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwmw@@GLIBCXX_3.4.5
  93. <a href="mailto:_ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEmmPKc@GLIBCXX_3.4" target="_blank">_ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEmmPKc@GLIBCXX_3.4</a>
  94. _ZNKSs11_M_disjunctEPKc@@GLIBCXX_3.4.5
  95. _ZN10__gnu_norm15_List_node_base6unhookEv@@GLIBCXX_3.4
  96. _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv@@GLIBCXX_3.4.5
  97. <a href="mailto:_ZNSi6ignoreEv@GLIBCXX_3.4" target="_blank">_ZNSi6ignoreEv@GLIBCXX_3.4</a>
  98. _ZNSs7_M_copyEPcPKcm@@GLIBCXX_3.4.5
  99. GLIBCXX_3.4.8
  100. GLIBCXX_3.4.13
  101. _ZSt11try_to_lock@@GLIBCXX_3.4.11
  102. _ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv@@GLIBCXX_3.4.5
  103. GLIBCXX_3.4.17
  104. GLIBCXX_3.4.4
  105. _ZNKSs15_M_check_lengthEmmPKc@@GLIBCXX_3.4.5
  106. <a href="mailto:_ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4" target="_blank">_ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4</a>
  107. _ZNSs4_Rep26_M_set_length_and_sharableEm@@GLIBCXX_3.4.5
  108. <a href="mailto:_ZNKSs11_M_disjunctEPKc@GLIBCXX_3.4" target="_blank">_ZNKSs11_M_disjunctEPKc@GLIBCXX_3.4</a>
复制代码
可以看到,输出已经包含了 GLIBCXX_3.4.20 和 GLIBCXX_3.4.21

再次执行  ./bootstrap ,故障解决。




上一篇:关于腾讯云服务器CentOSs 7.2安装 R软件和Rstudio的一些问题
下一篇:编译安装gcc-5.4.0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则