1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Building a DLL based mod in 2019

Discussion in 'Civ5 - SDK / LUA' started by whoward69, May 15, 2019.

  1. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,399
    Location:
    Near Portsmouth, UK
    I was going to title this "Adventures in Obtaining Unobtanium" …

    So I've got a shiny new Windows 10 64-bit laptop :)

    Steam and Civ V are installed, my mods are installed and I'm playing :) ... I even have the SDK downloaded and FireTuner working ... so I'm also cheating ;)

    ModBuddy next. Doesn't run by double-clicking the .exe file :( OK, I'll try it via Steam and the SDK start menu ... completing install ... looks promising ... needs VS-2010 Isolated Shell ... no longer exists on the Microsoft web site.

    Let the hunt for unobtanium begin!

    Trawling through my old notes, hard-disks and files I find it - much rejoicing :)

    But wait, at the back of my mind is something about needing to install VS-2008 first if you want to compile the DLL (and that's the whole point of this particular exercise) …

    Yep, in my notes "install VS-2008 before VS-2010 or you need to uninstall VS-2010 to fully install VS-2008"

    OK, lets find VS-2008 ... several hours (and much swearing later) ... got it!

    VS-2008, despite being only the web-installer, installs perfectly (looks like MS left all the VS-2008 .cab and .msi files on their servers and only removed the web pages to the VS-2008 installer download - please, no one tell them!)

    Perfectly? Mmmm. Let's see if the un-modded DLL code will compile. OMG, it does (using the 2008 solution file)

    Yeah! Feeling cocky, I install VS-2015 and try to compile DLL-VMC. BOOOO!!! All kinds of errors about missing build tools, but I thought those were in VS-2008.

    Hmmmm ... back to the notes. Looks like I also need VS-2010 SP1. Now I know where those are ... in the same backup as VS-2008 (perhaps I'm not as stupid as I look!)

    VS-2010 refuses to install ... oh yes, some idiot installed VS-2015 first ... right uninstall VS-2015 …

    VS-2010 now installs, and SP1 slips over it easily. Let's see if we can compile the unmodded DLL with VS-2010 (using the 2010 solution) ... YES!!!

    Feeling brave, I re-install VS-2015 (you've already guessed this is going to be a mistake, haven't you)

    DLL-VMC compiles :) (Quick burst of the "Hallelujah Chorus" can be heard in the background!)

    Let's start ModBuddy. Damn, got carried away and forgot the VS-2010 Isolated Shell (which was how I started this wild goose chase!).

    Damn! $#*^!!! Won't install. Ooops ... sheepishly ... I installed VS-2015 didn't I …

    Uninstall VS-2015 (why does this take so long?), install VS-2010 Isolated Shell. ModBuddy still won't start, something about different patch versions ... reapply VS-2010 SP1.

    Oh yeah! Cooking with gas! ModBuddy starts (can't remember exactly what the directories need to be set to, but I can copy those from my old setup later).

    Reinstall VS-2015 (third time lucky?) Hoo b****y ray! DLL-VMC still compiles and ModBuddy still works.

    So ... I could just stop here, but where's the fun in that? I want VS-2019!

    And anybody who guessed that that was going to be another epic just lost :)

    VS-2019 downloads and installs first time. So I start it up, open the DLL-VMC 2015 solution file (do NOT OK the dialog that prompts to udate the project, just Cancel it), and it compiles without problem. I'm amazed, I was expecting serious pain!

    Now all I have to do is find the time to start modding again.

    William

    In summary, to build a DLL based mod on a new Windows 10 machine
    * Install VS-2008
    * Install VS-2010
    * Install VS-2010 Isolated Shell
    * Install VS-2010 SP1
    * Download the Civ V SDK and start ModBuddy from the Steam SDK Menu (to complete the installation)
    * Install VS-2015 (optional)
    * Install VS-2019
    * Open the DLL source and compile it, when prompted to update the project, do NOT click OK, just Cancel
    * Start ModBuddy by double-clicking the .exe file
    * Start modding :)
     
    Serp, LastSword and Troller0001 like this.
  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,399
    Location:
    Near Portsmouth, UK
    When I've got the time (hopefully over the weekend), I'll upload all the required installers to my web site so they'll be available for the next 2 and a half years.
     
    Troller0001 likes this.
  3. bc1

    bc1

    Joined:
    Jan 12, 2004
    Messages:
    1,232
  4. MCG13

    MCG13 Chieftain

    Joined:
    Jul 4, 2017
    Messages:
    7
    Gender:
    Male
    Serp likes this.
  5. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    615
    thanks.
    I had a (preinstalled) trial of 2019 installed, but received errors ( https://forums.civfanatics.com/threads/dll-c-tutorial-discussion-thread.516109/page-2#post-15725199 )
    Now Installed 2008, 2010, 2010 Isolated and 2010 SP1 from the links bc1 provided.
    When I try to open the "CvGameCoreDLL.vs2015.sln" project from whowards dll, it opens without errors, but when trying to build it, it says it cant find "unordered_set" from CvGameCoreDLLPCH.h.
    I also tried again with 2019, but there I got the same errors like before when opening.

    So I guess I have to install 2015? I found iso links, but the download is whooping 7.1 GB big and I refuse to download such a big file... And I also dont want a "download installer", that is ~2-3 MB big, I just want 2015 Express for C++. Can someone link this?

    edit:
    btw @whoward69 your picknmix website is currently offline. Did you upload setup files there?

    edit2:
    I dont have to tell you that this visual studio mess is really frustrating. Are microsoft and dll devs serious with that?! Is this the way it is intended by microsoft?! Shouldn't developers switch to a software that also works after several years ?!
     
    Last edited: Apr 8, 2020
  6. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    615
    ...
    downloaded 10 GB to install 2015, after long installation time, told me that it cant install c++ because of newer version. deinstalled 2019 and repaired 2015.
    But even with 2015 I get the "missing unordered_set file" error when trying to build.
    So how do I get this?!
     
  7. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,399
    Location:
    Near Portsmouth, UK
    You're probably down to "rip it all out, all of it including VS-2008 and any .NET frameworks that were auto-installed, and then re-do it all slowly and in sequence"
     
  8. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    615
    dont you know in which net framework or service pack or visual studio version this "unordered_set" (or also unordered_map) libraries should be included?
    I really dont want to run the 2015 installation again, it took me with download 10 hours, my internet is horrible currently... Or should it also work with 2008 + 2010 (since I get in 2010 and 2015 the same missing library anyway? )
     
  9. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,399
    Location:
    Near Portsmouth, UK
    Why should I? It's a standard MS-VC++ component. It's a bit like me walking up to you and asking "Where does Amanda Britten live? Don't you know where everyone lives in your town?"
     
  10. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    615
    Because you are the master of dll :D And therefore I thought you also would have knowledge about c** and dll compiling and therefore also knowledge about Visual Studi and therefore also knowledge how/where all those libraries came from.

    But thank you anyway for your reply :)
    Maybe someone else can help and when I finaly was able to compile your dll and test few of my changes, I will present them to you and maybe you can implement some multiplayer fixes into your dll then :)
     
  11. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    615
    SOLVED
    guess I found the problem...
    I refused to use the link for 2008 from MCG13 above, because it was a "download during install" file, which I absolutely hate, while bc1 link was a complete ISO.
    But as MCG13 said, it lacks the Service pack, and thus also the unordered_set and other important files.

    I still received alot of "warnings" during building, but it still suceeded now. And first test ingame it seems to work :)
     

Share This Page