Classes in a DLL?

Hi I am making a custom dynamic link library and the linker is having a problem finding a reference

D:\Projects\c++\Royal Python Manager\main.cpp|25|undefined reference to `Database::getRecords(char const*)'|

Is their a particular way to using classes in a DLL? Why is it not linking I have set it all up correctly in the linker and linked it with the DLL file

Thanks,
Dan
Never mind I found out how. For anyone who also wants to know how it is easy enough. You just put "__declspec(dllexport)" after your class. For example

1
2
3
4
class __declspec(dllexport) test
{

};


If you are not linking the DLL with your application and you are loading it in directly using the LoadLibrary function you will not be able to access classes this way. You will need to make an interface.
Last edited on
Topic archived. No new replies allowed.