Quoting Vladimir Prus
Nigel Dyer wrote:
Hello
I am using the trunk release of boost, and started having problems with multiple definitions of symbols during linking (see example linker output below). I can cure the problem by removing the change to tools\build\v2\build\generators.jam introduced in revision 49800.
It only seems to occur if the following headers:
#include
#include #include are included in precompiled headers which are included in cpp files that are created by the antlr parser generator. It occurs on a compilation with darwin, but not msvc.
It is unclear whether the generator.jam change has identified a waekness in the boost libraries, or there is a problem with the revision 49800 change that only surfaces in obscure circumstances, or the change has highlighted a problem in my code. It can be fixed by removing the includes from the precompiled header. I feel this should not be necessary
It appears that some compiler bug is triggered by this change, but it's not yet clear how.
GCC PCHs were broken in the presence of anonymous namespaces in a header until version 4.2 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10591). I guess gcc/darwin has the same or similar problem.