This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14655] New: linker cannot find const static template members on HP


the following program:
--------------------------------------------------
template<class T>
struct S {
  static const int _i;
};

template<class T> const int S<T>::_i = 0;

int main()
{
  return S<char>::_i;
}
-----------------------------------------
result in this error:

northend:~/c> /usr/cygnus/gnupro-03r1p3/H-hppa1.1-hp-hpux11.00/bin/gcc  temp.cc
/usr/ccs/bin/ld: Unsatisfied symbols:
   S<char>::_i  (first referenced in /var/tmp//ccQMvubh.o) (data)
collect2: ld returned 1 exit status

I am working with ...

northend:~/c> /usr/cygnus/gnupro-03r1p3/H-hppa1.1-hp-hpux11.00/bin/gcc -v
Reading specs from
/usr/cygnus/gnupro-03r1p3/H-hppa1.1-hp-hpux11.00/lib/gcc-lib/hppa1.1-hp-hpux11.00/3.2-gnupro-03r1/specs
Configured with: /wv/cst7/gnupro-03r1/src/gnupro-03r1/src-native/configure
--src=/wv/cst7/gnupro-03r1/src/gnupro-03r1/src-native
--host=hppa1.1-hp-hpux11.00 --target=hppa1.1-hp-hpux11.00
--prefix=/usr/cygnus/gnupro-03r1p3
--exec-prefix=/usr/cygnus/gnupro-03r1p3/H-hppa1.1-hp-hpux11.00
--enable-languages=c,c++ --disable-nls

-- 
           Summary: linker cannot find const static template members on HP
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: thomas dot rudlof at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14655


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]