I was wondering how to properly export template classes that are
defined in a library. The problem is that this library defines a
template class:
template <typename T> class A {...};
and another class that uses a specific implementation of A, say
class B { class A<int> m_a; ...};
Following what I have read here and there, I exported class B, I did
not exported the templated class A, but exported class A<int>.
However, when compiling an executable against this library, for all
member function of A that are not inline (say, function 'setX'), I get
the following warning (using VC++6.0):
warning C4273: 'setX' : inconsistent dll linkage. dllexport assumed.
c:\program files\microsoft visual
studio\vc98\include\xmemory(59) :
while compiling class-template member function 'void __thiscall
A<int>::setX(int)'
The executable seems to run fine though. But I was wondering if I was
doing things correctly or if I missed a point.
Thanks for your help,
B.