使用BFD和MinGW

时间:2010-08-06 16:24:44

标签: c++ mingw

我实际上尝试使用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

有什么建议吗?

1 个答案:

答案 0 :(得分:1)

您是否还添加了libintl?如果你不需要重定位(由我指出的修补版本提供),我相信它是`gettext包的一部分。