Right now I do something like this and it seems messy if I end having a lot of functions I want to reference in my DLL. Is there a better and cleaner way of accessing the fu
After building your .dll get the .lib file nearby and link your test application with it. Use functions as they are declared in .h
There's a minor change you need to do in your header file:
#ifdef EXPORTS_API
#define MY_API_EXPORT __declspec (dllexport)
#else
#define MY_API_EXPORT __declspec (dllimport)
#endif
extern "C" {
int MY_API_EXPORT Factorial(int n);
// do the same for other functions
}
This way, when building your dll you define EXPORTS_API
in your project settings and functions get exported, in the client application, no need to define anything.