this is an "enhanced" version of bug 24389. The bug is still present, if the template variable is defined in a precompiled header.
Testcase: == header.h == #include <tr1/unordered_map> == 1.cpp == #include "header.h" == 2.cpp == #include "header.h" int main(){} compiling them: g++ -c header.h g++ 1.cpp 2.cpp ...gives us the known error: /tmp/ccLfG2oZ.o:(.bss+0x0): multiple definition of `std::tr1::(anonymous namespace)::ignore' /tmp/ccqbV1zU.o:(.bss+0x0): first defined here /tmp/ccLfG2oZ.o:(.bss+0x1): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_1' /tmp/ccqbV1zU.o:(.bss+0x1): first defined here /tmp/ccLfG2oZ.o:(.bss+0x2): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_2' /tmp/ccqbV1zU.o:(.bss+0x2): first defined here /tmp/ccLfG2oZ.o:(.bss+0x3): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_3' /tmp/ccqbV1zU.o:(.bss+0x3): first defined here /tmp/ccLfG2oZ.o:(.bss+0x4): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_4' /tmp/ccqbV1zU.o:(.bss+0x4): first defined here /tmp/ccLfG2oZ.o:(.bss+0x5): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_5' /tmp/ccqbV1zU.o:(.bss+0x5): first defined here /tmp/ccLfG2oZ.o:(.bss+0x6): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_6' /tmp/ccqbV1zU.o:(.bss+0x6): first defined here /tmp/ccLfG2oZ.o:(.bss+0x7): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_7' /tmp/ccqbV1zU.o:(.bss+0x7): first defined here /tmp/ccLfG2oZ.o:(.bss+0x8): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_8' /tmp/ccqbV1zU.o:(.bss+0x8): first defined here /tmp/ccLfG2oZ.o:(.bss+0x9): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_9' /tmp/ccqbV1zU.o:(.bss+0x9): first defined here /tmp/ccLfG2oZ.o:(.bss+0xa): multiple definition of `std::tr1::placeholders::(anonymous namespace)::_10' /tmp/ccqbV1zU.o:(.bss+0xa): first defined here It occurs with gcc-4.1 (gcc version 4.1.3 20071126 (prerelease)), but is fixed at least in 4.2.1 -- Summary: template variable not getting marked as weak when defined in pch Product: gcc Version: 4.1.3 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rbuergel at web dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34309