GetProcAddress cannot find my functions

喜你入骨 提交于 2019-11-29 11:28:47

The function you export is treated as a C++ function (because of *.cpp file extension) and so C++ name mangling is used to decorate the exported function name. If you use the Dependency Walker tool from Microsoft to inspect your created DLL you will see the functions full name.

You can either use that decorated name in your import code or force the compiler to export your function in C style, that is, in its undecorated form that your current import code expects.

You can tell the compiler to do so by adding extern "C" to your functions signature. Something like this:

extern "C" D3D_API_API void render();

Now your import code should work as expexted.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!