1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

[TUTORIAL] Setting up the build environment for RaR

Discussion in 'Civ4Col - Religion and Revolution' started by ShadesOfTime, May 16, 2018.

  1. ShadesOfTime

    ShadesOfTime Chieftain

    Joined:
    May 3, 2012
    Messages:
    10
    @Nightinggale,

    because devolution mentioned you here

    https://forums.civfanatics.com/thre...mod-development.438716/page-147#post-15127066

    I would like to ask you to help me setting up the build environment for rar. I have installed the 2003 SDK, VS 2010 and VS 2017 like devolution described.

    The - as far as I understand it - lines, special to my setup, in the makefile look like this:


    #############################################
    makefile snippet start
    #############################################

    #### Paths ####
    #
    # Note: $(PROGRAMFILES) converts to "C:\Program Files", "C:\Program Files (x86)" or whatever fits your system.
    # run "nmake.exe /P" in cmd.exe to see what it is on your system
    TOOLKIT=C:\Program Files\Microsoft Platform SDK 2003
    PSDK=$(PROGRAMFILES)\Microsoft SDKs\Windows\v7.0A
    ## Uncomment to have newly compiled dlls copied to your mod's Assets directory
    YOURMOD=..

    ## Civ install path
    ## Path to the directory where boost and python is stored
    ## Overwritten by enviroment variable CIV4_LIB_INSTALL_PATH
    CIV4_PATH=C:\Program Files (x86)\2K Games\Firaxis Games\Sid Meier's Civilization IV Colonization\CvGameCoreDLL

    #### Tools ####
    CC="$(TOOLKIT)\Bin\win64\cl.exe"
    CPP="$(TOOLKIT)\Bin\win64\cl.exe"
    LD="$(TOOLKIT)\Bin\win64\link.exe"
    RC="$(PSDK)\bin\rc.exe"

    #############################################
    makefile snippet end
    #############################################

    I forked the repository on sourceforge and I am at commit 690d87a171bb23ed87f2208816576dc5a749c38b (Size fitting of pioneer.) , which is the last commit in 2.7.1.beta2 as I understand. Still I can not make it compile without a cascade of compile errors. I tried in VS 2010 and VS 2017.

    I would very much like to fix this https://forums.civfanatics.com/thre...-bugs-and-todos.449958/page-121#post-15086562 for months now. And maybe contribute even more. But I am not capabel to find or set up the right tools.
    Can you help me?
     
  2. devolution

    devolution Chieftain

    Joined:
    Oct 7, 2016
    Messages:
    137
    Gender:
    Male
    Location:
    Stavanger, Norway
    Could you paste the (error) output / messages ?

    By the way, you have to switch to the correct branch (develop-2_7_1), the committ you are referring to is the last changeset in master.

    Edit:
    Why do you have:
    TOOLKIT=C:\Program Files\Microsoft Platform SDK 2003

    Surely it must be:
    TOOLKIT=$(PROGRAMFILES)\Microsoft Visual C++ Toolkit 2003

    The SDK is just lib and headers, not the compiler/linker binaries.

    Edit(again)
    I hope I didn't give you bad info, the SDK stuff is for getting Intel TBB to work I think, it is not necessary for compiling this branch. I guess there has been a mixup of terms (VS SDK vs. Platform SDK)

    After correcting this I think you'll be able to compile in no time :D
     
    Last edited: May 16, 2018
  3. Nightinggale

    Nightinggale Chieftain

    Joined:
    Feb 2, 2009
    Messages:
    3,745
    I spotted pretty much the same as what has already been mentioned. One thing I would like to add is that the idea is that whatever you put in Makefile.settings will overwrite the values in the makefile. This will allow everybody to use the same unmodified makefile and still allow each user to configure paths as needed. However failing to use Makefile.settings is not what is causing your problem. It's just a detail, yet a noteworthy one when multiple people work on the same source code.
     
  4. ShadesOfTime

    ShadesOfTime Chieftain

    Joined:
    May 3, 2012
    Messages:
    10
    hey guys,

    thanks for your answers.

    1.)
    Let's start here, maybe I installed the wrong kit after all. The kit I downloaded and installed is this one:
    https://www.microsoft.com/en-us/download/details.aspx?id=12261 .
    It would not let me install the 32-bit version, so I installed the 64-bit version. The 64-bit version goes to "C:\Program Files" on my rig, but $(PROGRAMFILES) resolves to "C:\Program Files (x86)". That is why I made this change in "Makefile".

    2.)
    I did so now ( at commit ed16b08d39e9593e5c1cd2cf2257682ed9ed58e1 , "GAME1: African slaves now have the same restrictions as native slaves with respect to allowed professions"), but get the same compile errors.

    3.)
    It starts with 20 of these (attribute not found):
    Code:
    Severity # Code # Description # Project # File # Line
    Error # C2337 # 'repeatable' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace # RaR # c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\CodeAnalysis\sourceannotations.h # 78	
    
    Then like 80 of these (syntax not understood) until it stops trying to compile:
    Code:
    Severity # Code # Description # Project # File # Line
    Error # C2059 # syntax error : '(' # RaR # C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h # 173	
    
    4.)
    Thanks for pointing that out. I was looking for a way of not tampering with Makefile.
     
  5. Nightinggale

    Nightinggale Chieftain

    Joined:
    Feb 2, 2009
    Messages:
    3,745
    This is really a red flag considering you can't compile. I wrote a 4 page wiki guide on how to compile Medieval Conquest for people who never compiled or used git before. You should take a look at the page Compiler setup. Note that you can skip the part about perl. I added that to M:C and it's not a requirement to RaR.
     
  6. ShadesOfTime

    ShadesOfTime Chieftain

    Joined:
    May 3, 2012
    Messages:
    10
    hi Nightinggale,

    thanks for your answer and your advice. So I had installed the wrong toolkit. No surprise, nothing worked.

    I went to the page you linked and followed the steps, but again I am stuck. I downloaded the "Microsoft Visual C++ Toolkit 2003" and tried to install it, but first I get 2 "failed to load resources from resource file. please check your setup" error messages followed by an InstallShield "error 1063: error installing .net framework". Then I uninstalled EVERYTHING I installed so far (all kits, all visual studios, ... which was quite a bit) but the error messages still pop up. Searching the web led me to believe, that these errors are caused by the C++ toolkit 2003 install program indefinitely trying to install the .net framework 1.1, which is prohibited on Win 10.

    See
    https://social.msdn.microsoft.com/F...from-resource-file?forum=winformsapplications
    and
    https://techjourney.net/install-mic...n-windows-10-8-7-vista-fix-regsvcs-exe-error/

    That is the state I am in at the moment. My next step will be to look into the .net 1.1 installation issue, hoping to be able to resolve the c++ toolkit 2003 installation errors.
     
  7. Nightinggale

    Nightinggale Chieftain

    Joined:
    Feb 2, 2009
    Messages:
    3,745
    Reason #417 to not install Windows 10.

    Have you considered using something like https://en.wikipedia.org/wiki/VirtualBox]VirtualBox? Just make it run XP or win7 and then use it when you want to compile. You don't have to use it to code or even debug. If you want a fancy setup, make visual studio connect to the virtual host and then use that one to build on a shared drive, meaning you can compile even without looking at the virtual machine manually.
     
  8. devolution

    devolution Chieftain

    Joined:
    Oct 7, 2016
    Messages:
    137
    Gender:
    Male
    Location:
    Stavanger, Norway
    I just installed the Civ4/Col compilation environment on a "clean" test machine running Windows 10 (don't ask me why I bother, I should start using wine again :/ )
    Following these instructions (https://forums.civfanatics.com/threads/a-simple-guide-to-compiling-the-dll.405444/), I downloaded and installed the 2003 toolkit as well as the SDK. I then downloaded Leoreth's VS2010 ISO and installed it.
    I then opened the RaR solution with VS2017 community edition and compiled without issues.

    I attempted to get the project to compile without VS2010, but alas it seems to be required (for now).

    Edit: More detailed/specific instructions:

    Download and extract:
    Microsoft Visual C++ Toolkit 2003 from
    http://www.mediafire.com/?iyfcfdd8eezh01m

    Do the same for:
    http://www.mediafire.com/?ilulm07imz9alnd

    Download, mount iso and install VS2003 from:
    https://sourceforge.net/projects/beyond-the-sword-sdk/files/VS2010Express1.iso/download

    Optional, but highly recommended:
    Download and install VS2017 from:
    https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15

    HTH
     
    Last edited: May 28, 2018 at 2:28 AM

Share This Page