• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM dll extension "LoadLibraryA failed with error code 4250"

H

HolgerssonEntertainment

Guest
Hello new GMC! This is my first post here! ;)

I'm working on an update for Fortify. I wrote a dll last spring that implements the matchmaking and peer to peer functionality from the Steam API. The update actually has nothing to do with the multiplayer, but when opening the project with GameMaker again the multiplayer had stopped working.

I updated the Steam SDK to 1.35a (following instructions here: http://help.yoyogames.com/hc/en-us/articles/216753748-SDK-Version-Support ) I also changed from VS2013 to VS2015.
Now I'm getting compile error: "LoadLibraryA failed with error code 1114"
After many attempts to fix it I decided to make a new dll extension with just a simple function in it but even that didn't work. Getting another error code: "LoadLibraryA failed with error code 4250"
Obviously I tried searching for these error codes but it didn't give me anything related to GM at all, so sadly not much help there :(

The new dll just looks like this

#define GMEXPORT extern "C" __declspec (dllexport)

GMEXPORT double Add(double x, double y)
{
return x + y;​
}

Using VS2015 C++
GMS version: 1.4.1763

Does anyone know if there has been any changes to the way GMS handles extensions?
What else could it be?
Please let me know if I need to clarify anything. Didn't want to write a book here. :p

Thanks!
Br,
Jonas Holgersson
 
Last edited by a moderator:
H

HolgerssonEntertainment

Guest
Thanks, I actually found that post during my searching. Though this was the first time I actually read it properly and did what it said. Unfortunately it didn't work :(

New information though. When i create a new Dll in VS2015 I can only choose "DLL (Windows Universal)" So I tried starting the game with the Windows UWP target in GMS. This actually made my simple addition dll work. But then Steam did not seem to initialize so I couldn't test the original DLL. Even if it worked with UWP I don't think that's what I would want for the game anyway as there seemed to be some scaling issues for example.

So my current theory is that VS2015 is not the best to use when making stuff for GMS. I'm trying out VS2012 now. Will report back if I figure out some more stuff...

Thanks again for the reply, even if it didn't work for me this time, I did get some energy back to try some new stuff! :D
 
H

HolgerssonEntertainment

Guest
New info!
Back on track with making a new dll. VS2012 didn't work. Then I downloaded an installer for vs2013. Some new tools for VS2015 was installed and so I got a new .dll starting project (Windows8) but it didn't work either.

So I started an empty project, set the Configuration type to .dll and the "Platform toolset" to Visual Studio 2013 (v120). Then the addition function dll worked.

Now I have a new problem. Step by step I started copying the old dll file content to the new project and now GameMaker crashes whenever I call a funciton in the dll that uses the Steam API.
 
I

icuurd12b42

Guest
reason your dll wont load on a user machine:
1) you forgot to install the msvc 2015 redist
2) you distributed the debug version

Same reason the steamapi may be crashing, you may need the msvc redist for that version... install all the ms redist packages from ms and see if that fixes it
 
H

HolgerssonEntertainment

Guest
reason your dll wont load on a user machine:
1) you forgot to install the msvc 2015 redist
2) you distributed the debug version
Thanks I'll try that! It's not the debug version though, I'm using the release one. :)
Edit: No I definitely have the latest msvc 2015 redist as well. :(
 
Last edited by a moderator:
H

HolgerssonEntertainment

Guest
The solution is probably really close now...
I noticed that in the steam_api.h file it can't find the definitions of the Steam functions. (See image)FunctionDefinitionNotFound.png
I was having trouble yesterday where the project would not compile because some (steam api related) unknown functions. I figured out how to link to the steam_api.lib file and those compile errors disappeared.
So does anyone know why the steam_api.h can't find the definitions for its functions?

Thanks for all the replies, hopefully this mess can be helpful to someone else in the future. :)
 
I

icuurd12b42

Guest
Are you using the right header file from the newer steam api? Also, if the function is defined in the lib file, then this auto complete error should possibly be normal..
 
H

HolgerssonEntertainment

Guest
Are you using the right header file from the newer steam api? Also, if the function is defined in the lib file, then this auto complete error should possibly be normal..
Yeah, I'm using all the files from the 1.35a sdk. As mentioned here: Steamworks SDK 1.35a (please use ONLY this version) - Stable/Beta/EA

It's so annoying to not know what the problem is. Like you said, these green underscore warnings could be normal. I think the definitions is in the lib file since I couldn't compile until I included the lib file in the project

Edit: Removed the inclusion of the lib file and these errors came back:
Error LNK2001 unresolved external symbol __imp__SteamUser GMP2PSteam C:\Users\Holgmeister 2.0\documents\visual studio 2015\Projects\GMP2PSteam\GMP2PSteam\GMCalls.obj 1
 
Top