I had the same problem, It boiled down to C++ name mangling. Basically, C++ needs to turn all your identifiers(for functions, classes, etc…) into unique identifiers for reasons, so it appends additional information to the names to make them truly unique.
I.E. it turns this:
You can see this if you view the exports from your DLL (You can dump/view the binary yourself, or get the DLL export viewer).
There are two solutions to the name mangling problem (that I’ve found). The first is to tell the compiler to compile your code as C instead of C++ using:
extern “C”
{
//Your code here
};
The second is to add a .def file, which eliminates the need for name mangling.