with the attached testcase, during linking you get: test2.o:(.data+0x0): multiple definition of `_ZN3BadIT_E2_yE' test1.o:(.data+0x0): first defined here this comes from a template class: template <class T> class Bad { static const int _y; }; template <class T> const int Bad<T>::_y = 1023; although this seems like a generic c++ problem, it was only observed on hppa-linux and not on other platforms. this test was simplified from a failure reported in building the quantlib package against g++-4.1. With earlier g++ versions the package builds fine.
Created attachment 12026 [details] testcase
This has been fixed already, both in GCC's SVN and in Debian's gcc-4.1 package. The reason you see it on HPPA is that recent version of gcc-4.1 in Debian don't build. This bug was fixed in -9 but hppa still has -8. Can you investigate why recent gcc-4.1 in Debian doesn't compile on HPPA? gcc-4.1 (4.1.1-9) unstable; urgency=low * Update to SVN 20060715. - Fix PR c++/28016, do not emit uninstantiated static data members. Closes: #373895, #376871. *** This bug has been marked as a duplicate of 28016 ***