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 new Tag in C2C code

Discussion in 'C2C mod mods' started by Thunderbrd, Dec 29, 2018.

  1. sorcdk

    sorcdk Chieftain

    Joined:
    Jun 26, 2014
    Messages:
    72
    Location:
    Denmark
    That cleaned up a lot, and those errors seem to be resolved now.
    There did show up a new error about a missing "python.h" file (a c/c++ header file, which might be either the civ4 code for handling python or a part of the python 2.4.x, I did try to set a python 2.4.6 installation as the GLOBALPYTHON target, since there is one under include/python.h, but that just pointed to a pyconfig.h).
    The build log is as follows:
    Spoiler Build log :

    Code:
      Microsoft (R) Program Maintenance Utility Version 14.16.27030.1
      Copyright (C) Microsoft Corporation.  All rights reserved.
     
      SubWCRev: 'D:\Programs\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Mods\Caveman2Cosmos\Sources'
      Last committed at revision 10528
      Updated to revision 10537
      Local modifications found
      Unversioned items found
          "C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /Zi /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"Final_Release\CvGameCoreDLL.pch" /Fd"./Final_Release/" /GR /Gy /W3 /EHsc /arch:SSE2 /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /Zm200 /DXERCES_STATIC_LIBRARY /D_MOD_SENTRY /D_MOD_FRACTRADE /D_MOD_GOVWORKERS /DQC_MASTERY_VICTORY /DLOG_AI /D_MOD_GWARM /D_MOD_SHAM_SPOILER /DC2C_BUILD /DMULTI_FEATURE_MOD /IBoost-1.32.0/include /IPython24/include /I"C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/include" /I"C:\Program Files (x86)\Microsoft Visual Studio\Shared\ExtraThings\Microsoft Platform SDK/Include" /I"C:\Program Files (x86)\Microsoft Visual Studio\Shared\ExtraThings\Microsoft Platform SDK/Include/mfc" /I"D:\Programs\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"D:\Programs\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\CvGameCoreDLL\Python24/include" /I"./xerces-c-3.1.1-x86-windows-vc-7.1/src" /YcCvGameCoreDLL.h /Fo"Final_Release\_precompile.obj" /c _precompile.cpp
      _precompile.cpp
    d:\Programs\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Mods\Caveman2Cosmos\Sources\CvGameCoreDLL.h(250): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\bin\cl.exe"' : return code '0x2'
      Stop.
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command "nmake Final_Release" exited with code 2.
    
     
  2. MattCA

    MattCA Warlord

    Joined:
    Jan 25, 2019
    Messages:
    194
    Gender:
    Male
    I wouldn't worry about any python stuff. It says the path for cl.exe is incorrect. If you don't have the special 2003 toolkit it was posted somewhere in moders documentation by Alberts2 (thanks for the post).
    If you've got it already check the path in your makefile.
    cl.exe is the first one under #### Tools #### for this makefile.
    the path for it is connected to your toolkit, so im guessing you have wrong toolkit or wrong path to toolkit.
    setting up vs is just a small test to see if u can handle all the failure you'll experience trying to learn the code.
    good luck

    Spoiler makefile :

    #### Paths ####
    TOOLKIT=C:\Program Files (x86)\Vc7
    PSDK=C:\Program Files (x86)\Microsoft Visual Studio\PSDK
    CIVINSTALL=C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword
    GLOBALBOOST=$(CIVINSTALL)\CvGameCoreDLL\Boost-1.32.0
    GLOBALPYTHON=$(CIVINSTALL)\CvGameCoreDLL\Python24
    TORTOISE="C:\Program files\TortoiseSVN"
    ## Uncomment to have newly compiled dlls copied to your mod's Assets directory
    YOURMOD=$(CIVINSTALL)\Mods\Caveman2Cosmos

    include xerces.mk

    #### Tools ####
    CC="$(TOOLKIT)\bin\cl.exe"
    CPP="$(TOOLKIT)\bin\cl.exe"
    LD="$(TOOLKIT)\bin\link.exe"
    RC="$(PSDK)\Bin\rc.exe"
    WCREV="$(TORTOISE)\bin\SubWCRev.exe"
    ## Uncomment to build dependencies using fastdep
    FD="C:\Program Files (x86)\fastdep\fastdep.exe"
     
  3. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,221
    Location:
    Norway
    This is the path for "Python.h".
    ...\Beyond the Sword\CvGameCoreDLL\Python24\include\Python.h
     
  4. sorcdk

    sorcdk Chieftain

    Joined:
    Jun 26, 2014
    Messages:
    72
    Location:
    Denmark
    In other words it is the python.h in python interpreter, which means it should have worked when I pointed the GLOBALPYTHON to a 2.4.6 installation, unless we need a very special version of python (maybe one integrated with boost?).

    The problem is that I dont have a natural ...\Beyond the Sword\CvGameCoreDLL\... folder, and the python/boost were not included as folders in the setups of CvGameCoreDLL folders I have found.
    It is possible that this may have something to do with this being a steam version (as you can see from some of the paths reported in the build log), and it would be a "bit" combersome to install it outside steam, since I would need to get an external optical drive to install my civ4 complete edition from cd(/dvd?) or go and resurrect an older computer.
     
  5. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,588
    Gender:
    Male
    Location:
    Las Vegas
    Thanks for clarifying. I did not know that.
     
  6. Anq

    Anq Prince

    Joined:
    Apr 14, 2019
    Messages:
    351
    Gender:
    Male
    Location:
    Anser (geese) HQ
    I can confirm this from a post on their forum. Steam did not include the sources with their distribution. That post links to a file in CivFanatics's Downloads by asaf. However this package he provided didn't include boost or python. For the convenience, I'll upload them here. These files go into the CvGameCoreDLL folder in your BtS install.
    If you're missing the whole CvGameCoreDLL folder, you may as well choose the second download, which includes the source code as well as boost and python.
     

    Attached Files:

    Last edited: May 12, 2019
  7. sorcdk

    sorcdk Chieftain

    Joined:
    Jun 26, 2014
    Messages:
    72
    Location:
    Denmark
    That seems to have done it, I can now have it successfully finish the compilation. I will have to actually do tests on whether the resulting .dll works, but that seems fairly likely.
    Thank you all very much for the help, especially Anq.
     
    MattCA and Anq like this.
  8. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,588
    Gender:
    Male
    Location:
    Las Vegas
    Man I'm terrible at helping with this sort of thing but I'm very glad you got it sorted out. Maybe I can be more help with in-code matters.
     
  9. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,221
    Location:
    Norway
    I have that folder in my steam edition of BtS... Maybe you need to opt into the beta version to get the source files.
    The beta version for BtS in steam is actually the official final release of BtS.
    Steam decided to update the game on their own after the gamespy servers went offline, and in the process steam removed multiplayer features that still worked.
    I would not be surprised if they decided to remove the source files thinking them junk files that were not needed.
    Link to relevant thread.
     

Share This Page