[SDK] Can't Build Solution/DLL

Alsark

Noble
Joined
Jul 10, 2006
Messages
841
Location
Fort Wayne, Indiana
Sorry, I'm really new to this, so hopefully I'm just overlooking something simple here... I've been following https://forums.civfanatics.com/threads/a-simple-guide-to-compiling-the-dll.405444/ but I am using Visual Studio 2013 (which I've noticed other people said works). Also, I'm on Windows 10 if that matters.

Whenever I try to build a solution, I get the following errors (attached). The errors all seem to be pointing to the SDK package files. I've tried both the Windows SDK from the Microsoft website as well as the one included in the linked thread.

I've also tried a couple of different make files (and edited them appropriately) - the one included in that thread, and the one that's already in Ashes of Erebus (the mod I'm trying to debug).

Thanks in advance.
 

Attachments

  • Visual Studio.PNG
    Visual Studio.PNG
    115.9 KB · Views: 246
Thanks for the reply! I got the same error with the MakeFile 2.5, unfortunately. It's odd, when I set the PSDK in MakeFile to a proper, correct path, I get the error included in my screenshot. If I give the PSDK a bogus path (something that doesn't exist like C:\Program Files (x86)\Test), I actually get much further (it actually seems to process the different cpp files), but still get an error. Not really sure how that makes much sense...
 
Last edited:
@Alsark

Did you manage to compile ? If not, I'll help you get going.

Note that you REALLY must use the VS2003 toolset, no other version of VS will (to my knowledge) manage to create a DLL that can interoperate with the Civ4 exe. The reason for this is that Microsoft has the habit of changing their ABI between each VS version, which means that data structures passed between the EXE and the DLL will differ in their binary layout. If only they had chosen to use COM\IUnknown :cry:
 
Note that you REALLY must use the VS2003 toolset, no other version of VS will (to my knowledge) manage to create a DLL that can interoperate with the Civ4 exe. The reason for this is that Microsoft has the habit of changing their ABI between each VS version, which means that data structures passed between the EXE and the DLL will differ in their binary layout. If only they had chosen to use COM\IUnknown :cry:
They screw up memory allocation as well if you mix versions, which is explained in the article Mixing Multiple Visual Studio Versions in a Program is Evil. I looked into using a newer compiler, GCC or similar and it doesn't look like it's doable, at least not without some serious hacks. Unless you are some sort of coding guru, you are stuck with MSVC 2003 like the rest of us.
 
Back
Top Bottom