GDC D2 编译:对“_Unwind_SjLj_XYZ”的未定义引用
我刚刚下载了 GDC (gcc-4.5.2-tdm-1-gdc-r575-20110723.zip) 与 MinGW-w32 一起使用,并在尝试编译/链接文件时,出现以下错误:
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:167: undefined reference to `_Unwind_SjLj_RaiseException'
c:/mingw-w32/bin/../lib/gcc/mingw32/4.5.2/../../..\libgphobos2.a(deh.o): In function `D3gcc3deh17parse_lsda_headerFPS3gcc14unwind_generic15_Unwind_ContextPhPS3gcc3deh16lsda_header_infoZPh':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:546: undefined reference to `_Unwind_GetRegionStart'
c:/mingw-w32/bin/../lib/gcc/mingw32/4.5.2/../../..\libgphobos2.a(deh.o): In function `D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwind_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:294: undefined reference to `_Unwind_GetLanguageSpecificData'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:308: undefined reference to `_Unwind_GetIP'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:516: undefined reference to `_Unwind_SetGR'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:521: undefined reference to `_Unwind_SetGR'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:523: undefined reference to `_Unwind_SetIP'
c:/mingw-w32/bin/../lib/gcc/mingw32/4.5.2/../../..\libgphobos2.a(stdio.o): In function `D3std5stdio4File5closeMFZv':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:441: undefined reference to `_Unwind_SjLj_Register'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:454: undefined reference to `_Unwind_SjLj_Unregister'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:446: undefined reference to `_Unwind_SjLj_Unregister'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:454: undefined reference to `_Unwind_SjLj_Resume'
...
如何修复此问题?
I just downloaded GDC (gcc-4.5.2-tdm-1-gdc-r575-20110723.zip) to use with MinGW-w32, and upon trying to compile/link a file, I got these errors:
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:167: undefined reference to `_Unwind_SjLj_RaiseException'
c:/mingw-w32/bin/../lib/gcc/mingw32/4.5.2/../../..\libgphobos2.a(deh.o): In function `D3gcc3deh17parse_lsda_headerFPS3gcc14unwind_generic15_Unwind_ContextPhPS3gcc3deh16lsda_header_infoZPh':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:546: undefined reference to `_Unwind_GetRegionStart'
c:/mingw-w32/bin/../lib/gcc/mingw32/4.5.2/../../..\libgphobos2.a(deh.o): In function `D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwind_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:294: undefined reference to `_Unwind_GetLanguageSpecificData'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:308: undefined reference to `_Unwind_GetIP'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:516: undefined reference to `_Unwind_SetGR'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:521: undefined reference to `_Unwind_SetGR'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:523: undefined reference to `_Unwind_SetIP'
c:/mingw-w32/bin/../lib/gcc/mingw32/4.5.2/../../..\libgphobos2.a(stdio.o): In function `D3std5stdio4File5closeMFZv':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:441: undefined reference to `_Unwind_SjLj_Register'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:454: undefined reference to `_Unwind_SjLj_Unregister'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:446: undefined reference to `_Unwind_SjLj_Unregister'
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:454: undefined reference to `_Unwind_SjLj_Resume'
...
How do I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mehrdad,看起来 TDM 的 GDC 包是使用 --enable-sjlj-exceptions 标志构建的,但是您的 GCC 是官方 MinGW,并且它可能不是使用(过时的)SJLJ 异常处理构建的。互联网上有一个“普通”GDC 软件包,我建议您尝试一下。
Mehrdad, it looks like TDM's GDC package is built with --enable-sjlj-exceptions flag, but your GCC is the official MinGW, and it is probably not build with (obsolete) SJLJ exception handling. There is a "normal" GDC package available on the Internet, I suggest you try that one.