我实际上尝试使用MinGW编译使用bfd库(binutils的一部分)的应用程序。我已将libiconv 1.13和gettext 0.17包添加到我的MinGW目录中。如果我编译我的源代码包括bfd:
$ g++ iftest.cpp -o iftest -llibiconv -lbfd -liberty
这会导致以下链接错误:
c:/binrev/development/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libbfd.a(libbfd.o):libbfd.c:(.text+0x6ee): undefined reference to `libintl_dgettext'
c:/binrev/development/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libbfd.a(libbfd.o):libbfd.c:(.text+0x740): undefined reference to `libintl_dgettext'
c:/binrev/development/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libbfd.a(libbfd.o):libbfd.c:(.text+0x79b): undefined reference to `libintl_dgettext'
c:/binrev/development/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libbfd.a(libbfd.o):libbfd.c:(.text+0x7d0): undefined reference to `libintl_dgettext'
c:/binrev/development/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libbfd.a(bfd.o):bfd.c:(.text+0x8fd): undefined reference to `libintl_dgettext'
c:/binrev/development/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libbfd.a(bfd.o):bfd.c:(.text+0x964): more undefined references to `libintl_dgettext' follow
collect2: ld returned 1 exit status
有什么建议吗?