Tom Hilinski <[EMAIL PROTECTED]> writes:

> I'm unable to get template code that builds with g++ 3.4.x to link
> successfully in g++ 4.0.x

I am suprised your code builds with gcc-3.x (but it does build with
my gcc-3.3.3). I was also able to reproduce your build failure
using gcc-4.1-20051022 snapshot.

> I'd appreciate any suggestions.

What you are doing is non-portable: when the instantion requests below
are seen by g++, it has not seen the body of ATemplate<T>::GetValue()
yet, and therefore can't actually instantiate anything.

> template class ATemplate<int>;
> template class ATemplate<float>;

Here is a fix:

  $ cat ATemplate.cpp
  #include "ATemplate.h"
  template <class T> T ATemplate<T>::GetValue () const { return n; }
  template class ATemplate<int>;
  template class ATemplate<float>;

Your ATemplateInst.h serves no apparent purpose anyway.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to