Hey all, so this seems to be a rather strange issue to me. I have a very simple templatized container class which is part of a DLL. The entire class is defined in a header file, to allow automatic template generation. Now another part of the DLL actually requests a certain template type to be generated, so the code should exist within the DLL. However, when using the object from another executable, the constructor/destructor, plus multiple other functions work, however 2 functions are not found by the linker. Following are is the code for these two functions, as well as for a working function.
const T** getData() const
{
return m_data;
}
int getNumRows() const
{
return m_nRows;
}
int getNumCols() const
{
return m_nCols;
}
So the getNumRows() and getNumCols() functions are not found by the linker, however the getData() function is. Is this a common problem, do the functions need to have a templatized parameter in order to be generated?
@1 800 INFORMATION
I have exported this from the DLL via a standard macro:
#ifdef ACORE_EXPORTS
#define ACORE_API __declspec(dllexport)
#else
#define ACORE_API __declspec(dllimport)
#endif
And at the class definition:
template < class T >
class ACORE_API matrix