reviver
January 16th, 2005, 09:52 AM
I use vs.net 2003 created a dll project (uncheck export symbols), when i wrote following code:
void __declspec(dllexport) test()
{
}
build the project will generate a export lib.
But when I wrote following code:
[In Math.h]
#ifdef MATHDLL_EXPORTS
#define _MATHCLASS __declspec(dllexport)
#else
#define _MATHCLASS __declspec(dllimport)
#endif
template <typename T>
class _MATHCLASS Math
{
public:
T Add(T x, T y);
};
[In Math.cpp]
template <typename T>
T Math<T>::Add(T x, T y)
{
return x + y;
}
Build the project only output a dll file, I have checked the setting as follows:
Linker->General: Ignore import library - NO
Linker->Advanced: Import Library: $(OutDir)/MathDLL.lib
Any one knows the problem? Or where i do wrong.
Thanks for your help, thx in advance!
void __declspec(dllexport) test()
{
}
build the project will generate a export lib.
But when I wrote following code:
[In Math.h]
#ifdef MATHDLL_EXPORTS
#define _MATHCLASS __declspec(dllexport)
#else
#define _MATHCLASS __declspec(dllimport)
#endif
template <typename T>
class _MATHCLASS Math
{
public:
T Add(T x, T y);
};
[In Math.cpp]
template <typename T>
T Math<T>::Add(T x, T y)
{
return x + y;
}
Build the project only output a dll file, I have checked the setting as follows:
Linker->General: Ignore import library - NO
Linker->Advanced: Import Library: $(OutDir)/MathDLL.lib
Any one knows the problem? Or where i do wrong.
Thanks for your help, thx in advance!