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

How to compile the DLL

Discussion in 'Civ5 - SDK / LUA' started by DaveMcW, Nov 2, 2012.

  1. DaveMcW

    DaveMcW Chieftain

    Joined:
    Oct 8, 2002
    Messages:
    6,489
    Updated for the BNW SDK.
     
  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,295
    Location:
    Near Portsmouth, UK
    One of the warnings when building the latest source (which whizzes up the screen) is

    "module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance"

    Right click the project, select Properties and change the setting as shown to remove this
     

    Attached Files:

  3. rf900

    rf900 Chieftain

    Joined:
    Jan 31, 2006
    Messages:
    194
    Not sure if it is appropriate to ask here, do you know if I can include the 3 DLLs in the same mod? Will the game be "smart" enough to use the one corresponding to the activate DLCs the user has?
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,295
    Location:
    Near Portsmouth, UK
    You can't include the base/vanilla dll in a mod anyway, but the other two you can - see here http://forums.civfanatics.com/showthread.php?t=501252
     
  5. Prymor

    Prymor Chieftain

    Joined:
    Jun 26, 2006
    Messages:
    2
    How to compile the BNK SDK with VS2012?
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,295
    Location:
    Near Portsmouth, UK
    At a guess the same way as you do for VS2008/VS2010 (as Firaxis supply the project config files for VS2012, and fixed the major issues in the last patch with the project config files for VS2010)

    If it's not compiling/building for you, we're going to need specific error messages.
     
  7. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,062
    Location:
    America
    You need VS 2008 installed to have the toolset needed to compile the project (which is a 2008 VC++ project regardless of the solution).
     
  8. PlotinusRedux

    PlotinusRedux Chieftain

    Joined:
    Jul 11, 2013
    Messages:
    196
    I don't see a problem with all or most DLL modders sharing a single project on an open source site, provided we all make any functional changes (i.e., changes beyond just creating a new event) able to be toggled on or off via the DB or LUA so other modders can control whether they want to use each individual change or not at run time.
     
  9. Alzadar

    Alzadar Chieftain

    Joined:
    Dec 9, 2012
    Messages:
    204
    Do the source files in CvGameCoreDLL and CvGameCoreDLL_Expansion1 have any effect if there's a same-name source file in CvGameCoreDLL_Expansion2?

    Basically, which of the three folders should I be making changes to? Do I need to modify them all?
     
  10. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,366
    Location:
    France
    Only the files from the folder you want to compile. (CvGameCoreDLL = vanilla civ5, CvGameCoreDLL_Expansion1 = G+K, CvGameCoreDLL_Expansion2 = BNW)

    If your making a DLL for G+K, make your change in CvGameCoreDLL_Expansion1.

    If later you want to make a DLL for BNW, any feature you've added in your G+K's DLL will have to be ported in the files in CvGameCoreDLL_Expansion2.

    BTW, now you can (must ?) use "OnGetDLLPath/SetDLLPatch" action, your DLL can then have any name and the "Import into VFS" property set to true is not needed.
     
  11. S3rgeus

    S3rgeus Chieftain

    Joined:
    Apr 10, 2011
    Messages:
    1,270
    Location:
    London, United Kingdom
    It's probably a good idea to use the DLLPath settings but you don't have to, the old VFS way still works.
     
  12. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,295
    Location:
    Near Portsmouth, UK
    How does it differentiate which DLL is for Vanilla, G&K or BNW - or does this only work for one DLL in a mod?
     
  13. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,366
    Location:
    France
    Only one DLL in a mod set this way. That DLL will be loaded whatever expansion is used.

    So, good for total conversion, but yeah, the VFS = true method is still the only way for one mod including DLLs for each version of the game.
     
  14. S3rgeus

    S3rgeus Chieftain

    Joined:
    Apr 10, 2011
    Messages:
    1,270
    Location:
    London, United Kingdom
    What happens if a mod loads a BNW DLL into an install that doesn't have BNW? Surely there are missing functions or extra function calls that will cause crashes?
     
  15. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,295
    Location:
    Near Portsmouth, UK
    It would. But the mod should be setting the correct "dependant on" associations to avoid this situation
     
  16. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,366
    Location:
    France
    It crashes, but from missing tables/entries in the Database IIRC.
    The .exe and all other DLL are common to all versions of the game.
     
  17. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,295
    Location:
    Near Portsmouth, UK
    The game core API (both in methods available and signatures) differ across all three versions
     
  18. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,366
    Location:
    France
    oh, my bad :o

    But now I'm curious, how does it works ?
     
  19. sonasi

    sonasi Chieftain

    Joined:
    Jan 29, 2006
    Messages:
    3
    Location:
    Pensacola, FL
    Anyone have specifics regarding the required toolset and the dependency for a successful compilation? Seems that fresh install of VS2010 or VS2012 should be able to do the job with at most an add-on tool install. Guess I just don't like having to install an older VS just to get the newer VS to work properly. Additionally, to read that the installation order matters [Thanks whoward] just seems ridiculous though not shocking considering it's from MS. So far in my software development life I've managed to stay away from having to use VS and be thrust into MS's version of common sense. ;)
     
  20. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,062
    Location:
    America
    The actual c++ project is a VC2008 vcxproj file, even though there are solutions for VS 2008, 2010, and 2012 (the 2012 one works in 2013 as well). So you need the VC2008 toolchain to compile it.
     

Share This Page