Trying to compile an application that uses bfd library (a part of beanutils) I face that bfd itself is in turn dependent on libintl which is missed. This leads to the following linkage error:
g++ -ostack_trace_win32.exe src\utils.o src\stack_trace_win32.o src\StackTrace.o src\Exception.o -lbfd -liberty -lopcodes
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x8fd): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x964): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x998): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x9c6): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x1115): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x1157): more undefined references to `libintl_dgettext' follow
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Information about GCC:
C:\>gcc -v
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.4.0/configure --enable-languages=c,ada,c++,fortran,jav
a,objc,obj-c++ --disable-sjlj-exceptions --enable-shared --enable-libgcj --enabl
e-libgomp --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enab
le-version-specific-runtime-libs --prefix=/mingw --with-gmp=/mingw/src/gmp/root
--with-mpfr=/mingw/src/mpfr/root --build=mingw32
Thread model: win32
gcc version 4.4.0 (GCC)
C:\>ld -v
GNU ld (GNU Binutils) 2.18.50.20080625
Is it actually missing? Did you install libiconv? (The latter is stated as a mandatory prerequisite for gcc-4.4.0, and it also provides libintl). What does the output show, if you add the -### option to your g++ command line? -lintl is conspicuously absent from your explicit options; it also seems not to be added implicitly, which might be a built-in specs deficiency, or it may just be an omission on your part; (you will need to consult the GCC maintainers upstream, for clarification).
Yes, it is acually missing, because a) there is no file named liblibintl.a b) search within the lib directory within file content by the libintl_dgettext function name returns nothing
libiconv distributed here http://www.mingw.org/wiki/Getting_Started is just a dll without the above mentioned fucntion within. So, this cannot help. I have another, static, version of libiconv and again it does not contain the function.
Neither -lintl nor -llibintl are presented within the command line just because there are no such libraries provided within binutils package for MinGW, so there is no sense to add them - it just will cause "missing library" linkage error.
Compilation with libinconv-2:
g++ -LC:\Projects\AFC\libintl\Debug -LC:\Programs\mingw\bin -shared -olibstack_trace_win32.exe src\utils.o src\stack_trace_win32.o src\StackTrace.o src\Exception.o -llibiconv-2 -lbfd -liberty
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x8fd): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x964): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x998): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x9c6): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x1115): undefined reference to `libintl_dgettext'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libbfd.a(bfd.o):bfd.c:(.text+0x1157): more undefined references to `libintl_dgettext' follow
collect2: ld returned 1 exit status
If it is ok to have a package inside MinGW which is not self-sufficient having only MinGW packages then of course this is not a bug. It is odd though.
It isn't a bug. However, you do seem to have discovered an hitherto unidentified dependency: you need to install gettext-0.17-1-mingw32-dev.tar.lzma, and likely also libintl-0.17-1-mingw32-dll-8.tar.lzma, both of which you will find it the MinGW gettext package set on our SF downloads page; (apologies for previously pointing you erroneously to the libiconv packages). After installing these, you will then need to add the `-lintl' selector (`-llibintl' would be very, very wrong!) to your command line.
Thanks for reporting this. This dependency has arisen with a more recent release of GNU binutils than was available when the Getting Started page was written. At the very least, we should update the page to reflect the change; we should also include the dependency within mingw-get's distribution manifest, for affected versions of the binutils package.
Ok then. The only issue as for now is that https://sourceforge.net/projects/mingw/files does not provide any possibility to download these libraries. Or are they placed somewhere else?
Look again. They are precisely where I've already told you to look, on precisely that site where you claim they are not, (and for the record, I downloaded them myself, from there, just this morning).
Yes indeed. I have found them. It was not an easy task, but these libs are actually there.
Earnie,
I set it as "remind" because I'm not yet sure if we'll need to add a dependency on libintl, for current binutils, in mingw-get's XML package description. I'd prefer to keep this open until we resolve that, one way or the other.
Ping, Keith is this still an issue?