ImportError:启动Eclipse调试器时没有名为“libstdcxx”的模块

时间:2016-01-17 10:09:47

标签: linux eclipse gcc gdb eclipse-cdt

当我在Linux中运行Eclipse CDT调试器时,我在GDB控制台中看到以下错误:

The target endianness is set automatically (currently little endian)
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'

这是什么意思,我可以解决它,我应该修复它吗?

1 个答案:

答案 0 :(得分:0)

这已在更新版本的libstdc ++ 6中修复。现在,编辑libstdc++.so.6.0.19-gdb.py文件以进行这些更改(来自Ubuntu 14.04的示例):

*** libstdc++.so.6.0.19-gdb.py.orig 2015-05-14 11:41:01 -0700
--- libstdc++.so.6.0.19-gdb.py 2016-01-17 08:00:54 -0800
***************
*** 49,54 ****
      # Compute the ".."s needed to get from libdir to the prefix.
!     backdirs = len (libdir.split (os.sep))
!     if not os.path.basename(os.path.dirname(__file__)).startswith('lib'):
!         backdirs += 1 # multiarch subdir
!     dotdots = ('..' + os.sep) * backdirs

--- 49,51 ----
      # Compute the ".."s needed to get from libdir to the prefix.
!     dotdots = ('..' + os.sep) * len (libdir.split (os.sep))