我实际上试图使用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
有什么建议么?
最佳答案
您还添加了libintl吗?如果您不需要重定位(由我所指出的补丁版本提供),我相信它是gettext包的一部分。