You are exporting a C++ function, which is subject to name mangling. You want to export a C function which is not subject to name mangling. You can either do that by wrapping your class (which is totally useless as is by the way), or by not even doing that to begin with.

Your cpp file:
Code:
#include <iostream>

extern "C" __declspec(dllexport) void Crap();

void Crap()
{
   std::cout << "Hello world" << std::endl;
}



Please, since you are starting to touch C++, never even start getting used to "using namespace xyz", since it defeats all purposes namespaces have. Also note that "cout" will write to stdout (which in its normal form doesn't even exist on Windows), and you won't see the output of it ever. If you just want to know wether it works, maybe try this:

Code:
#include <iostream>

extern "C" __declspec(dllexport) int FancyMultiply(int a, int b);

int FancyMultiply(int a, int b)
{
   return a * b;
}




Lite-C
Code:
int FancyMultiply(int a, int b);
#define PRAGMA_API FancyMultiply;SimpleDll!FancyMultiply

void main()
{
   printf("8 * 24 = %d", FancyMultiply(8, 24)); 
}



Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com