Created attachment 22817
Example
Please see the attached files. Templated class functions that are specialized,
aren't added to the list of exported functions. In the attached example, any
binary linking to this shared library will fail to find dll<int>::Func().
// dll.hpp
#ifdef DLL_EXPORT
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
template <typename T>
struct dll
{
DLL_API static void Func();
};
// dll.cpp
#define DLL_EXPORT
#include "dll.hpp"
#include <stdio.h>
template <>
void dll<int>::Func()
{
printf("dll<int>::Func1\n");
}
template class DLL_API dll<int>;
declspec_dllexport.zip
(1000 bytes, application/x-zip-compressed)