The g++ compiler version and machine information are as follows: Reading specs from /usr/lib/gcc/ppc64-redhat-linux/3.4.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --enable-shared --enable-threads=posix --disable- checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind- exceptions --enable-languages=c,c++,objc,java,f77 --enable-java-awt=gtk -- host=ppc64-redhat-linux --build=ppc64-redhat-linux --target=ppc64-redhat-linux - -with-cpu=default32 Thread model: posix gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
Here is a simple testcase: #include <ios> template <typename T> class A: public std::locale::facet { public: const char* a1; void f(){ a1 = std::locale::facet::_S_get_c_name(); //a1=_S_get_c_name(); <- this line also gives the same error. } }; int main() { A<int> obj; obj.f(); } Compiling the testcase with g++ compiler, I am getting the linking error: /tmp/ccM4h5sR.o(.gnu.linkonce.t._ZN1AIiE1fEv+0x20): In function `A<int>::f()': : undefined reference to `std::locale::facet::_S_get_c_name()' collect2: ld returned 1 exit status The problem is the static member function _S_get_c_name() which is declared in the <bits/locale_classes.h> is not defined. -- Summary: static member function not defined in std::locale::facet class Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P1 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yanliu at ca dot ibm dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18684