wowserhq / blizzardry

JavaScript library for mastering the wizardry that is Blizzard's game files
MIT License
54 stars 15 forks source link

Hardcoded Windows DLL dependencies #75

Open DDuarte opened 8 years ago

DDuarte commented 8 years ago

Related to #51

The file c-lib.js hardcodes the VC runtime library msvcr120 making it only compatible with DLLs built with Visual Studio 2013. This causes Node to crash when external DLLS (libstorm.dll, libblp.dll) are compiled with a different VS version, e.g, ucrtbase/ucrtbased should be used if compiling with VS 2015 (or above).

timkurvers commented 8 years ago

Ah good point! When Peter and I looked at this, only Node 0.10 and 0.12 were relevant. Is there any way to dynamically fetch the DLL-name based on node-gyp?

timkurvers commented 8 years ago

Or at least, if I remember correctly, the version Node was compiled with needs to match the version the libraries get compiled with.

DDuarte commented 8 years ago

I'm afraid it doesn't matter what Node or node-gyp uses.

Right now (however this could change if more file formats are added and so on), the only thing that matters is that the runtime DLL specified in c-lib matches the runtime linked with libblp (because fopen is used as an argument to blp_processFile).

Honestly I don't know how to make this generic. At least, after version 14.0 (VS 2015), the runtime library filename is no longer versioned (there's no msvcr140), only ucrtbase(d).