[Bug c++/42330] undefined reference to "static const int" in class when passing as "const int &" to a function

aijunbai at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 8 13:02:00 GMT 2009



------- Comment #7 from aijunbai at gmail dot com  2009-12-08 13:02 -------
(In reply to comment #6)
> (In reply to comment #5)
> > > 
> > > template<int N> const A<N>::i;
> > > 
> > 
> > I tried so, but it seems do not work, could you please explain more detailedly?
> > thx~
> 
> I missed the "int" out:
> 
> template<int N> const int A<N>::i;
> 

thanks for your help, but it still can not be compiled under gcc 4.4.1


-- 


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



More information about the Gcc-bugs mailing list