Date: Mon, 20 Dec 2004 01:18:47 -0700 From: Bradford Castalia <Castalia@idaeim.com> To: barner@gmx.de Cc: ports@FreeBSD.org Subject: FreeBSD Port: boost-1.31.0 Message-ID: <41C68AE7.AA6C6902@idaeim.com>
next in thread | raw e-mail | index | archive | help
After installing the boost-1.31.0 port on FreeBSD 4.8 I found that code using the regex library would not build (compile, but not link) successfully. This same code was building and running without any difficulty on FreeBSD 5.3 amd64 (also from a package installation), Darwin (OS-X powerpc) 7.6.0, and Solaris 5.9 all using the same boost 1.31.0 distribution. In all cases the same distribution of boost is being used and the gcc 3.x compiler is being used. The link phase would fail due to unresolved references to various boost regex symbols. On searching the libboost_regex.a library I discovered that the references were present, except that allocator was not qualified with std:: in the signature. Thus the undefined references, with std::allocator, would not match the library symbols. Digging deeper I discovered the dependency on the BOOST_DEFAULT_ALLOCATOR(T) macro. By replacing this macro with std::allocator<T> wherever it occurred in the regex headers (the macro is defined in detail/allocator.hpp but only used in the regex headers) and rebuilding the libraries (using the gcc.mak and gcc-shared.mak makefiles in libs/regex/build) the library was generated with the correct symbols and the code will now build and run correctly. I'm sure there is a better solution than the blunt fix I used for my case - the BOOST_DEFAULT_ALLOCATOR(T) macro is clearly intended to address issues on several platforms - but I have not taken the time to track the logic back to its source. -- Bradford Castalia Senior Systems Analyst Planetary Image Research Laboratory University of Arizona
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41C68AE7.AA6C6902>