underbent / slashdiablo-maphack

A customized maphack for the slashdiablo D2 server
49 stars 89 forks source link

compiling from source with newer libraries #7

Open beastwick opened 8 years ago

beastwick commented 8 years ago

The linker failed trying to find StormLib.lib so I grabbed the most recent Git for StormLib and compiled the project. That project doesn't produce a StormLib.lib file, but instead outputs a StormLib_dll.lib file. I renamed the file and updated the linker input settings in VS2010 to point to this file. The build compiled successfully.

However, now when I try to run the injector it crashes on reading the MPQ archives. It crashes in a StormLib function

TMPQArchive * IsValidMpqHandle(HANDLE hMpq) { TMPQArchive * ha = (TMPQArchive *)hMpq;

return (ha != NULL && ha->pHeader != NULL && ha->pHeader->dwID == ID_MPQ) ? ha : NULL;

}

The ha structure has all bad data that can't be read and I get a win32 unhandled exception error.

Truth be told I know that this project is really old now and I've just tried compiling with a recent StormLib version (9.20).

Do you have any ideas why I may be running into this problem?

slayergod13 commented 8 years ago

There are different build configurations for the Stormlib project. They all produce slightly different versions of the library; be sure you build the correct one (I don't recall which one is correct off the top of my head).