我刚刚下载了GDC (gcc-4.5.2-tdm-1-gdc-r575-20110723.zip)与MinGW-w32一起使用,在试图编译/链接文件时,我得到了这些错误:
C:crossdevgdcv2buildmingw32libphobos/../../../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:crossdevgdcv2buildmingw32libphobos/../../../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:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:294: undefined reference to `_Unwind_GetLanguageSpecificData'
C:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:308: undefined reference to `_Unwind_GetIP'
C:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:516: undefined reference to `_Unwind_SetGR'
C:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/gcc/deh.d:521: undefined reference to `_Unwind_SetGR'
C:crossdevgdcv2buildmingw32libphobos/../../../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:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:441: undefined reference to `_Unwind_SjLj_Register'
C:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:454: undefined reference to `_Unwind_SjLj_Unregister'
C:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:446: undefined reference to `_Unwind_SjLj_Unregister'
C:crossdevgdcv2buildmingw32libphobos/../../../gcc-4.5.2/libphobos/std/stdio.d:454: undefined reference to `_Unwind_SjLj_Resume'
...
如何解决这个问题?
Mehrdad,看起来TDM的GDC包是用——enable-sjlj-exceptions标志构建的,但是您的GCC是官方的MinGW,并且它可能不是用(过时的)SJLJ异常处理构建的。网上有一个"正常"的GDC包,我建议你试试。