This is merely a problem of
name mangling. You exported name is
not "
show
". To see what is actually exported, it's good to use some binary dump tool, such as DUMPBIN.EXE (see
http://msdn.microsoft.com/en-us/library/c1h23y6c(v=VS.100).aspx[
^]). It is bundled with every version of Visual Studio; you can run it using "Visual Studio Command Prompt". It will show you the mangled name you should pass to
GetProcAddress
(see
http://msdn.microsoft.com/en-us/library/ms683212(v=vs.85).aspx[
^]).
To avoid name mangling, you can use
extern "C"
:
#ifdef __cplusplus
extern "C" { void __declspec(dllexport) show() { }
#endif
Name mangling or
name decoration is the C++ feature helping developers to pretend they are working in type-safe environment, where the signatures of functions are checked. In real life, as it is all based on the gravely obsolete object file name-based linkage, this is no more than a dirty trick. Real type safety between executable modules was invented and used decades ago. In modern time it exists, for example, in the form of .NET
meta-data
.
For explanation of name mangling, see
http://en.wikipedia.org/wiki/Name_mangling[
^].
—SA