-
DLL and GCC
I think this is a basic question...
Could anyone tell me please, how to import DLLs using GCC?
I'm using Dev C++...
This one keep failing... :(
Code:
#define IMPORT __declspec (dllimport)
template<typename T>class IMPORT TestClass {
public:
T add(T a, T b);
};
int main() {
TestClass<int> test;
test.add(10, 20);
};
Code:
[Linker error] undefined reference to `TestClass<int>::add(int, int)'
Thanks in advance.
-
I don't know if I've quite got a hold of what you're asking, but if your DLL has a definition of a template function in it, that's not going to do you any good, since a template definition doesn't compile into anything and g++ doesn't support export yet.