[SOLVED] IncludingCustom DLL LoadLibrary Error

I'm trying to write a custom DLL, but I can't get it to run in rpgmaker. I followed this tutorial: http://www.rpgmakercentral.com/topic/18757-writing-your-own-dll-and-calling-it-from-rm/


It crashes with a LoadLibrary error. I think the dll is being correctly located (procmon output is completely different if i reference the file name incorrectly), but something is going wrong. It fails when attempting to initialize the library, before trying call it. I've played around with methods and arguments, but everything gives the same error. These are all the references to the dll in procmon below. Any ideas what the problem is, or how to go about investigating the issue?

upload_2017-6-14_1-20-41.png




Here's the C++ files:

upload_2017-6-14_1-20-51.png


upload_2017-6-14_1-21-0.png




And here's the Ruby:

upload_2017-6-14_1-22-1.png
Might be a compilation issue. You are using Code::Blocks where as the tutorial uses Visual C++
Hey, thanks a lot Zeriab. It worked right out of the box in VS. I was hoping to use a lightweight editor, but I'm happy to have anything that actually works.

Still wondering though, can you guess how I might get this to work in a C++ IDE? Is rpgmaker maybe not compatible with GCC or MinGW? I tried both in codeblocks and codelite. I've never programmed with anything lower-level than c#, so this environment is kind of hard to figure out

Original thread: https://forums.rpgmakerweb.com/threads/solved-includingcustom-dll-loadlibrary-error.79927/