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

A simple guide to compiling the DLL

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Asaf, Dec 29, 2010.

  1. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    @ kormer: the Boost-1.32.0 folder is normally located in the Beyond the Sword/CvGameCoreDLL folder (same for Python24).

    Code:
    GLOBALBOOST=$(CIVINSTALL)\CvGameCoreDLL\Boost-1.32.0
    GLOBALPYTHON=$(CIVINSTALL)\CvGameCoreDLL\Python24
    
    If you have put the CvGameCoreDLL folder in another location, then you have to update your Makefile.

    @ Vexalor: are you trying to load a saved game?
     
  2. kormer

    kormer Chieftain

    Joined:
    Nov 13, 2002
    Messages:
    81
    I don't have a \Boost-1.32.0 or \Python24 directory with my CvGameCoreDLL folder. I grabbed the one off the original post in here as for some reason the Steam version I have doesn't appear to have those folders. Is there someplace else I can find them?

    EDIT for anyone else suffering this same problem: I found the boost and python folders necessary in the archive linked below. Adding those to my CvGameCoreDLL directory and then updating the makefile to point to them worked to successfully compile.

    http://www.gamefront.com/files/files/4985569/civ4_sdk_source.zip
     
  3. ThorHammerz

    ThorHammerz zzz

    Joined:
    Jul 31, 2014
    Messages:
    836
    Thanks!
     
  4. Zlatko

    Zlatko CIW

    Joined:
    Apr 1, 2010
    Messages:
    713
    Location:
    Solar System
    I have one problem with compiling. FOR TARGET i used BTS source codes.
    I have 2 PCs:
    - first: WIN XP SP3 32-bits
    - second: WIN 7 Ultimate 64-bits

    XP compile BTS source codes successfully, WIN 7 unsuccessfully. WHY ? I DON'T KNOW.

    I used Visual Studio 2010 Ultimate on both PCs.

    I do SAME on both PCs before compiling, i attached one RAR file (see attachment),
    RAR file, have 4 files:
    - XP_Makefile (Makefile from WIN XP)
    - XP_OUTPUT (VS2010 output from WIN XP)
    - WIN7_Makefile (Makefile from WIN 7)
    - WIN7_OUTPUT (VS2010 output form WIN 7)

    Please see image (WIN 7 Error list):
    LNK1123
    LNK1141
    MSB3073
    U4010
    U4011

    HOW TO FIX THIS ON WIN 7 maybe something is missing on my WIN 7 ? Please help me.

     

    Attached Files:

  5. Zlatko

    Zlatko CIW

    Joined:
    Apr 1, 2010
    Messages:
    713
    Location:
    Solar System
    Spoiler :


    I AM FIX PROBLEM WITH MSB3073 error.
    I HAVE TWO METHODS:


    FIRST METHOD:

    - First read this tutorial and try to do all steps in tutorial, install all which is necessary (RECOMEDED): http://modiki.civfanatics.com/index.php/How_to_Install_the_SDK
    if you fail you can try my methods, members please correct me if I'm wrong somewhere, thanks.

    This is more notes than tutorial and its experimental nature.

    - Go to "Documents\Visual Studio 2010\Projects", create new folder there, give them name which you want, I am give name BTS
    - Go to your Beyond the Sword folder, "Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL"
    and copy all files from "CvGameCoreDLL" folder except "CvGameCoreDLL.rc" and "CvGameCoreDLL.vcproj"
    copy files to "Documents\Visual Studio 2010\Projects\Your Project name", my is BTS ("Documents\Visual Studio 2010\Projects\BTS")
    - Go here (DannyDaemonic thread) http://forums.civfanatics.com/showthread.php?t=370861 and download "Makefile+fastdep.7z (82.4 KB)" and "VS2010 Project Files.7z (2.8 KB)"
    and extract these two files in "Documents\Visual Studio 2010\Projects\Your Project name" in my case "Documents\Visual Studio 2010\Projects\BTS"
    - If you read tutorial and install all which is necessary to work, and if paths is default, there is no need to change anything in your "Makefile", except if you install them on some another location

    One more thing: "Microsoft SDKs\Windows\v7.0A" is automatic install during Visual Studio 2010 Ultimate installation, but you can download them from internet.

    Default paths, check where is your "Microsoft Visual C++ Toolkit 2003" and "Microsoft SDKs" here is their default location, "Makefile" appearance:
    TOOLKIT=C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003
    PSDK=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A

    - Next step, open your Visual Studio, File -> Open -> Projects/Solution and find your folder "Documents\Visual Studio 2010\Projects\Your Project name", my case "Documents\Visual Studio 2010\Projects\BTS"
    and choose "CvGameCoreDLL.vcxproj" and click Open
    If you get Security Warning pop-up click OK, and wait until VS load all files, in down left corner you will see "Ready" when VS finish loading files for project, I always wait that, but do is important to wait, not sure.
    - Choose Debug or Release what you want (Debug is default), choose Build -> Build Solution, Windows will ask you where you want to save your "CvGameCoreDLL.sln" file, just click Save and wait for your "CvGameCoreDLL.dll" file.
    I am try this method several times on Windows 7 Ultimate 64-bits (compile BTS source code) and its succeed.

    - I am tested this with new files, after successful build, I am replace my files (Source BTS) with source files from LoR (only .h and .cpp files) in "Documents\Visual Studio 2010\Projects\BTS"
    - Open Visual Studio, File -> Open -> Projects/Solution, find my folder "Documents\Visual Studio 2010\Projects\BTS" and open again "CvGameCoreDLL.vcxproj", not "CvGameCoreDLL.sln" (Different with .sln and .vcxproj files, maybe I think to know), maybe some experienced programmer can explain this
    - Repeat steps from previous paragraph (From: "If you get Security Warning pop-up..."), BUT THIS TIME I AM CHOOSE "Build -> Rebuild Solution", because I have already built solution, let's rebuild them.
    - I am successful compile LoR with this method.

    If you get error MSB3073 there is something wrong with your Makefile or with .vcxproj file.
    In .vcxproj file is almost configuration problem (When you open VS2010, choose Project -> Properties, click on Configuration Properties and on NMake
    this part is explain in tutorial http://modiki.civfanatics.com/index.php/How_to_Install_the_SDK from Configuration you can choose Active(Debug), Debug, Release, All Configuration
    In all of these configurations you have "Build Command Line", "Rebuild All Command Line", "Clean Command Line", "Output", you must all of this configure property.

    SECOND METHOD:

    - First read this tutorial and try to do all steps in tutorial, install all which is necessary (RECOMEDED): http://modiki.civfanatics.com/index....nstall_the_SDK
    if you fail you can try my method, members please correct me if I'm wrong somewhere, thanks.

    This method is explain in tutorial http://modiki.civfanatics.com/index.php/How_to_Install_the_SDK but I will explain this on my way:
    - Open Visual Studio
    - File -> New -> Project
    - From "Installed Templates" choose "Visual C++" choose "General" choose "Makefile Project"
    - Name: write some name for your project, in my case I will write "NEW_BTS"
    - Location: "\Documents\Visual Studio 2010\Projects\", my case: "C:\Users\Aleksandar\Documents\Visual Studio 2010\Projects\"
    - UNCHECK the box that says "Create Directory for Solution"
    - Click OK
    - Makefile Project Wizard will open, click Next, clear all text box, click Next, click Finish.
    - Let's configure the compiler. Click Project -> Properties, The "Your Project Name Properties Pages" window will open, in my case "NEW_BTS Name Properties Pages".
    - In the left-hand box under "Configuration Properties" select "NMake"

    - Select the "Debug" configuration from the "Configuration:" drop-down-box in the top left corner.
    - In the right-hand box under "General" it says "Build Command Line".
    - Click the empty box to the right of it and type nmake Debug
    - In "Rebuild All Command Line" type nmake Debug_clean Debug
    - In "Clean Command Line" type "$(VCInstallDir)bin\nmake.exe" Debug_clean
    - In "Output" type CvGameCoreDll.dll

    - Select the "Release" configuration from the "Configuration:" drop-down-box in the top left corner.
    - In "Build Command Line" type nmake Release
    - In "Rebuild All Command Line" type nmake Release_clean Release
    - In "Clean Command Line" type "$(VCinstallDir)bin\nmake.exe" Release_clean
    - In "Output" type CvGameCoreDll.dll
    - Click OK

    - Go to your Beyond the Sword folder, "Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL"
    and copy all files from "CvGameCoreDLL" folder except "CvGameCoreDLL.rc" and "CvGameCoreDLL.vcproj"
    - In Visual Studio In Solution Explorer (Left Side in VS, if your VS is set to C++ settings)
    left click on "Your Project Name", in my case "NEW_BTS" and choose "Open Folder in Windows Explorer" OR open folder "Documents\Visual Studio 2010\Projects\Your Project Name"
    in my case "Documents\Visual Studio 2010\Projects\NEW_BTS"
    - Paste here, in "Documents\Visual Studio 2010\Projects\Your Project Name", copied files from "Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL"

    - In VS, Project -> Add Existing Item
    - Add Existing Item window will open, You can see File name, right from him, you will see select box, in which you can choose:
    All Files(*.*), Visual C++ Files, Web Files, and etc.
    You only want to add: all *.h files, all (2) *.inl files, all *.cpp files and the both subfolders. Let's add them
    Choose "Visual C++ Files", Select everything (use Ctrl+A) and click -Add-.
    Only add all .h all .cpp all .inl and Boost-1.32.0 folder and Python24 folder don't add any other file with another extension.

    - Go here (DannyDaemonic thread) http://forums.civfanatics.com/showthread.php?t=370861 and download "Makefile+fastdep.7z (82.4 KB)"
    and extract this file in "Documents\Visual Studio 2010\Projects\Your Project name" in my case "Documents\Visual Studio 2010\Projects\NEW_BTS"
    - If you read tutorial and install all which is necessary to work, and if paths is default, there is no need to change anything in your "Makefile", except if you install them on some another location

    One more thing: "Microsoft SDKs\Windows\v7.0A" is automatic install during Visual Studio 2010 Ultimate installation, but you can download them from internet.

    Default paths, check where is your "Microsoft Visual C++ Toolkit 2003" and "Microsoft SDKs" here is their default location, "Makefile" appearance:
    TOOLKIT=C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003
    PSDK=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A

    - Save your Project
    - Choose Debug or Release what you want (Debug is default), choose Build -> Build Solution
    - I am try this method several times on Windows 7 Ultimate 64-bits (compile BTS source code) and its succeed.

    - I am tested this with new files, after successful build, I am replace my files (Source BTS) with source files from Advanced Diplomacy (only .h and .cpp files) in "Documents\Visual Studio 2010\Projects\NEW_BTS"
    - Open Visual Studio, File -> Open -> Projects/Solution, find my folder "Documents\Visual Studio 2010\Projects\NEW_BTS"
    - Open your .vcxproj file
    I am repeat this step:
    - In VS, Project -> Add Existing Item ... add only .h, .cpp, .inl and Boost-1.32.0 folder and Python24 folder, this time and every next you will have several new folders like Debug, Release, etc.. deselect them.
    - Save your Project
    - Choose Debug or Release what you want (Debug is default), choose Build -> Rebuild Solution, REBUILD THIS TIME.
    - I am successful compile Advanced Diplomacy with this method.
     
  6. Terkhen

    Terkhen King

    Joined:
    Aug 1, 2011
    Messages:
    912
    Gender:
    Male
    Location:
    Granada
  7. Snidely

    Snidely Chieftain

    Joined:
    Jan 3, 2011
    Messages:
    10
    (Edit: Never mind, I've found out the problem. I wasn't using Asaf's source files for some reason. I sorted that, recompiled, deleted the .rc file as suggested by Fanatic Demon here, and the mod works. Sorry to be a bother, please tell me if I should delete this post.)

    I'm a newbie who's managed to compile a .dll, but it crashes when I try to load the game with my mod. I haven't changed any code yet. I've used the base files where possible, the boost/python folders linked by kormer, and then the project files from the first post on top of those.

    When I try to debug I get the following in the output window:
    Spoiler :
    Code:
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\Civ4BeyondSword.exe', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\boost_python-vc71-mt-1_32.dll', Binary was not built with debug information.
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\python24.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\secur32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\msvcr71.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\msvcp71.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\zlib1.dll', Binary was not built with debug information.
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\binkw32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\oleacc.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\steam_api.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\d3dx9_33.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\Mss32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization iv beyond the sword\Beyond the Sword\hapdbg.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18305_none_5cb72f2a088b0ed3\comctl32.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Program Files\Bluetooth Software\syswow64\BtMmHook.dll', Cannot find or open the PDB file
    'Civ4BeyondSword.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file
    The program '[2776] Civ4BeyondSword.exe: Native' has exited with code 84 (0x54).


    I also get an error pop-up window called "Steam error", saying "Application load error T:0000065432".

    Here's the altered segment of my makefile.
    The boost/python folders have been placed in (civinstall)\assets by me, I gather that's not their default location. Trying to put it any deeper caused problems with compilation due to the length of the dir.

    I'm using VS 2010 Express, if that helps. Anyway, chances are that I've done something daft, but my Google skills have failed me. Does anyone know what I'm messing up?
     
  8. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,182
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    Well, I decided to try my hand at this once more, but once again, it fails to work for me...

    I used both my own BTS's files as well as the archive mentioned in the guide, but neither worked. I overwrote these files with RevDCM's files (the mod I base my own mod off). I then merged the six files found here with those of RevDCM, but alas, the compilation failed.

    Attached is my whole folder.
     

    Attached Files:

  9. Lemon Merchant

    Lemon Merchant Forum Buzzkill Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,409
    Gender:
    Female
    Location:
    Red Sector A
    What is the specific problem you're having?
     
  10. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,182
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    This.

    One thing strikes me in particular:

    1>C:\Program wordt niet herkend als een interne
    1>of externe opdracht, programma of batchbestand.

    Apparently, it treats the space in 'Program Files' as a separation, and tries to execute the command ('assignment'?) 'C:\Program. But it doesn't recognise this as an internal or external assignment, program, or batch file.
     
  11. Lemon Merchant

    Lemon Merchant Forum Buzzkill Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,409
    Gender:
    Female
    Location:
    Red Sector A
    Could you zip and post your makefile, please? Also, try running visual studio as Administrator.
     
  12. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,182
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    Isn't that included in the above .rar? The files come from this guide, overwritten by RevDCM's files, and then I manually merged the six files of the BonusCommerceYields mod.
     
  13. Snidely

    Snidely Chieftain

    Joined:
    Jan 3, 2011
    Messages:
    10
    Frustratingly, I can't recall 100% how I got around that particular problem. So take this advice with a pinch of salt.

    I think I got it to work by making the makefile use a more specific DIR. In my case:
    Code:
    PSDK=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
    While reading about this problem, I also ran across a post that replaced the spaces in the DIR path with underscores. I'm not sure if that works or not.
     
  14. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,182
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
  15. Snidely

    Snidely Chieftain

    Joined:
    Jan 3, 2011
    Messages:
    10
    Yep, I got that too. The second post on this page (shortcut for convenience's sake) solves that. I recommend you extract the Boost-1.32.0 and Python24 folders to a place that's got a shorter DIR than a BTS mod; I lazily extracted them to my MyMod folder, and I got errors because of that. My current DIR works fine at the moment, using these lines in the makefile:

    Code:
    CIVINSTALL=C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword
    GLOBALBOOST=$(CIVINSTALL)\Assets\Boost-1.32.0
    GLOBALPYTHON=$(CIVINSTALL)\Assets\Python24
     
  16. Zlatko

    Zlatko CIW

    Joined:
    Apr 1, 2010
    Messages:
    713
    Location:
    Solar System
    @need my speed
    I am test your files and i am get MSB3073 error which i am described several post above how to fix that #305
    You have bad makefile !
    Your MAKEFILE:
    Code:
    PSDK=C:\Program Files\Microsoft Platform SDK
    First you use wrong PSDK, i haven't that PSDK and when i was that PSDK i cannot compile with that PSDK.
    I use
    Code:
    PSDK=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
    One more thing: "Microsoft SDKs\Windows\v7.0A" is automatic install during Visual Studio 2010 Ultimate installation, but you can download them from internet.

    next, you miss CIVINSTALL= In my makefile that is:
    Code:
    CIVINSTALL=E:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword
    next, you miss this below CIVINSTALL
    Code:
    GLOBALBOOST=$(CIVINSTALL)\CvGameCoreDLL\Boost-1.32.0
    GLOBALPYTHON=$(CIVINSTALL)\CvGameCoreDLL\Python24
    next, your makefile have this:
    Code:
    Debug_GLOBAL_CFLAGS= /D_MOD_SENTRY /D_MOD_FRACTRADE /D_MOD_GOVWORKERS /DLOG_AI /D_MOD_GWARM /D_MOD_SHAM_SPOILER
    Final_Release_GLOBAL_CFLAGS= /D_MOD_SENTRY /D_MOD_FRACTRADE /D_MOD_GOVWORKERS  /D_MOD_GWARM /D_MOD_SHAM_SPOILER
    my makefile really haven't that and it's not need.

    Next, you have Zi flag, this flag can cause proble remove it, your make file:
    Code:
    Debug_CFLAGS=/MD /Zi /Od /D_DEBUG /RTC1 /Fp"$(Debug_PCH)" $(GLOBAL_CFLAGS) $(Debug_GLOBAL_CFLAGS)
    Release_CFLAGS=/MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"$(Release_PCH)" $(GLOBAL_CFLAGS)  $(Final_Release_GLOBAL_CFLAGS)
    
    my makefile:
    Code:
    Debug_CFLAGS=/MD /Od /D_DEBUG /RTC1 /Fp"$(Debug_PCH)" $(GLOBAL_CFLAGS)
    Release_CFLAGS=/MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"$(Release_PCH)" $(GLOBAL_CFLAGS)
    
    next, you have this:
    Code:
    GLOBAL_INCS=/I"$(TOOLKIT)/include" /I"$(PSDK)/Include" /I"$(PSDK)/Include/mfc"
    
    i have this:
    Code:
    GLOBAL_INCS=/I"$(TOOLKIT)/include" /I"$(PSDK)/Include" /I"$(PSDK)/Include/mfc" /I"$(GLOBALBOOST)/include" /I"$(GLOBALPYTHON)/include"
    
    next, you have this:
    Code:
    GLOBAL_LIBS=/LIBPATH:"$(TOOLKIT)/lib" /LIBPATH:"$(PSDK)/Lib" winmm.lib user32.lib
    
    i have this:
    Code:
    GLOBAL_LIBS=/LIBPATH:"$(TOOLKIT)/lib" /LIBPATH:"$(PSDK)/Lib"  /LIBPATH:"$(GLOBALBOOST)/libs" /LIBPATH:"$(GLOBALPYTHON)/libs" winmm.lib user32.lib
    
    And next you have made several syntax error in your code. That is from me.
    Here is MakeFile from my mod which really good work, just change your path correct and fix your syntax errors:
    Spoiler :
    Code:
    #### Civilization 4 SDK Makefile 1.0 ####
    ####  Copyright 2010 Danny Daemonic  ####
    #########################################
    
    #### Paths ####
    TOOLKIT=C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003
    PSDK=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
    CIVINSTALL=E:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword
    GLOBALBOOST=$(CIVINSTALL)\CvGameCoreDLL\Boost-1.32.0
    GLOBALPYTHON=$(CIVINSTALL)\CvGameCoreDLL\Python24
    ## Uncomment to have newly compiled dlls copied to your mod's Assets directory
    #YOURMOD=$(CIVINSTALL)\Mods\MyMod
    
    #### Tools ####
    CC="$(TOOLKIT)\bin\cl.exe"
    CPP="$(TOOLKIT)\bin\cl.exe"
    LD="$(TOOLKIT)\bin\link.exe"
    RC="$(PSDK)\bin\rc.exe"
    ## Uncomment to build dependencies using fastdep
    FD="$(MAKEDIR)\bin\fastdep.exe"
    
    #### BLACKLIST ####
    ## Uncomment to block CvTextScreen (accidentally included by Firaxis)
    BLACKLIST=CvTextScreens
    
    #### You shouldn't need to modify anything beyond this point ####
    #################################################################
    
    #### Target Files ####
    Debug_BIN=Debug\CvGameCoreDLL.dll
    Release_BIN=Release\CvGameCoreDLL.dll
    
    !IF [IF NOT EXIST CvGameCoreDLL.rc EXIT 1] == 0
    Debug_RESOURCE=Debug\CvGameCoreDLL.res
    Release_RESOURCE=Release\CvGameCoreDLL.res
    !ENDIF
    
    Debug_STATICLIB=Debug\CvGameCoreDLL.lib
    Release_STATICLIB=Release\CvGameCoreDLL.lib
    
    Debug_LIBDEF=Debug\CvGameCoreDLL.def
    Release_LIBDEF=Release\CvGameCoreDLL.def
    
    Debug_PCH=Debug\CvGameCoreDLL.pch
    Release_PCH=Release\CvGameCoreDLL.pch
    
    Debug_PDB=Debug\CvGameCoreDLL.pdb
    Release_PDB=Release\CvGameCoreDLL.pdb
    
    Debug_OTHER=Debug\CvGameCoreDLL.exp Debug\CvGameCoreDLL.ilk
    Release_OTHER=Release\CvGameCoreDLL.exp
    
    #### CFLAGS ####
    GLOBAL_CFLAGS=/GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h"
    Debug_CFLAGS=/MD /Od /D_DEBUG /RTC1 /Fp"$(Debug_PCH)" $(GLOBAL_CFLAGS)
    Release_CFLAGS=/MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"$(Release_PCH)" $(GLOBAL_CFLAGS)
    
    #### LDFLAGS ####
    GLOBAL_LDFLAGS=/DLL /NOLOGO /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /TLBID:1
    Debug_LDFLAGS=/INCREMENTAL /DEBUG /PDB:"$(Debug_PDB)" /IMPLIB:"$(Debug_STATICLIB)" $(GLOBAL_LDFLAGS)
    Release_LDFLAGS=/INCREMENTAL:NO /OPT:REF /OPT:ICF /PDB:"$(Release_PDB)" $(GLOBAL_LDFLAGS)
    
    #### INCLUDES ####
    GLOBAL_INCS=/I"$(TOOLKIT)/include" /I"$(PSDK)/Include" /I"$(PSDK)/Include/mfc" /I"$(GLOBALBOOST)/include" /I"$(GLOBALPYTHON)/include"
    PROJECT_INCS=/IBoost-1.32.0/include /IPython24/include
    Debug_INCS=$(PROJECT_INCS) $(GLOBAL_INCS)
    Release_INCS=$(PROJECT_INCS) $(GLOBAL_INCS)
    
    #### LIBS ####
    GLOBAL_LIBS=/LIBPATH:"$(TOOLKIT)/lib" /LIBPATH:"$(PSDK)/Lib"  /LIBPATH:"$(GLOBALBOOST)/libs" /LIBPATH:"$(GLOBALPYTHON)/libs" winmm.lib user32.lib
    PROJECT_LIBS=/LIBPATH:Python24/libs /LIBPATH:boost-1.32.0/libs/ boost_python-vc71-mt-1_32.lib
    Debug_LIBS=$(PROJECT_LIBS) $(GLOBAL_LIBS) msvcprt.lib
    Release_LIBS=$(PROJECT_LIBS) $(GLOBAL_LIBS)
    
    #### Objects ####
    Debug_LINKOBJS=$(Debug_OBJS)
    Release_LINKOBJS=$(Release_OBJS)
    
    #### Auto SOURCES/OBJS ####
    !IF [ECHO SOURCES= \> sources.mk] == 0 && \
        [FOR %i IN (*.cpp) DO @ECHO. "%i" \>> sources.mk] == 0 && \
        [ECHO.>> sources.mk] == 0 && \
        [ECHO Debug_OBJS= \>> sources.mk] == 0 && \
        [FOR /F "delims=." %i IN ('dir /b *.cpp') DO @ECHO. Debug\%i.obj \>> sources.mk] == 0 && \
        [ECHO.>> sources.mk] == 0 && \
        [ECHO Release_OBJS= \>> sources.mk] == 0 && \
        [FOR /F "delims=." %i IN ('dir /b *.cpp') DO @ECHO. Release\%i.obj \>> sources.mk] == 0 && \
        [ECHO.>> sources.mk] == 0
    !INCLUDE sources.mk
    !IF [DEL sources.mk]
    !ENDIF
    !ENDIF
    
    #### Targets ####
    #################
    
    .PHONY: all clean Debug_clean Release_clean Debug Release
    
    all: Debug Release
    
    clean: Debug_clean Release_clean 
    
    Debug_clean:
    	@FOR %i IN ($(Debug_BIN) $(Debug_STATICLIB) $(Debug_LIBDEF) \
    		Debug\*.obj Debug\*.@ $(Debug_RESOURCE) \
    		$(Debug_PCH) $(Debug_PDB) $(Debug_OTHER)) DO @IF EXIST "%i" DEL "%i"
    
    Release_clean:
    	@FOR %i IN ($(Release_BIN) $(Release_STATICLIB) $(Release_LIBDEF) \
    		Release\*.obj Release\*.@ $(Release_RESOURCE) \
    		$(Release_PCH) $(Release_PDB) $(Release_OTHER)) DO @IF EXIST "%i" DEL "%i"
    
    Debug: Debug_DIR Debug_unfinished $(Debug_PCH) $(Debug_BIN)
    !IFDEF YOURMOD
    	-COPY "$(Debug_BIN)" "$(YOURMOD)\Assets\."
    !ENDIF
    
    Release: Release_DIR Release_unfinished $(Release_PCH) $(Release_BIN)
    !IFDEF YOURMOD
    	-COPY "$(Release_BIN)" "$(YOURMOD)\Assets\."
    !ENDIF
    
    Debug_DIR:
    	-@IF NOT EXIST "Debug\." MKDIR "Debug"
    
    Release_DIR:
    	-@IF NOT EXIST "Release\." MKDIR "Release"
    
    Debug_unfinished:
    	@ECHO.>Debug\unfinished.@
    	@FOR /F "delims=@" %i IN ('dir /b Debug\*.@') DO \
    		@IF EXIST "Debug\%i" DEL "Debug\%i"
    	@FOR /F %i IN ('dir /b Debug\*.@') DO \
    		@IF EXIST "Debug\%i" DEL "Debug\%i"
    
    Release_unfinished:
    	@ECHO.>Release\unfinished.@
    	@FOR /F "delims=@" %i IN ('dir /b Release\*.@') DO \
    		@IF EXIST "Release\%i" DEL "Release\%i"
    	@FOR /F %i IN ('dir /b Release\*.@') DO \
    		@IF EXIST "Release\%i" DEL "Release\%i"
    
    $(Debug_BIN): $(Debug_LINKOBJS) $(Debug_RESOURCE)
    	$(LD) /out:$(Debug_BIN) $(Debug_LDFLAGS) $(Debug_LIBS) $(Debug_LINKOBJS) $(Debug_RESOURCE)
    
    $(Release_BIN): $(Release_LINKOBJS) $(Release_RESOURCE)
    	$(LD) /out:$(Release_BIN) $(Release_LDFLAGS) $(Release_LIBS) $(Release_LINKOBJS) $(Release_RESOURCE)
    
    .cpp{Debug}.obj:
    	@ECHO.>"$*.obj.@"
        $(CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /Fo$*.obj /c $<
    	@DEL "$*.obj.@"
    
    .cpp{Release}.obj:
    	@ECHO.>"$*.obj.@"
        $(CPP) /nologo $(Release_CFLAGS) $(Release_INCS) /Fo$*.obj /c $<
    	@DEL "$*.obj.@"
    
    $(Debug_PCH) Debug\_precompile.obj:
    	@ECHO.>"$(Debug_PCH).@"
    	@ECHO.>"Debug\_precompile.obj.@"
    	$(CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /YcCvGameCoreDLL.h /Fo"Debug\_precompile.obj" /c _precompile.cpp
    	@DEL "$(Debug_PCH).@"
    	@DEL "Debug\_precompile.obj.@"
    
    $(Release_PCH) Release\_precompile.obj:
    	@ECHO.>"$(Release_PCH).@"
    	@ECHO.>"Release\_precompile.obj.@"
        $(CPP) /nologo $(Release_CFLAGS) $(Release_INCS) /YcCvGameCoreDLL.h /Fo"Release\_precompile.obj" /c _precompile.cpp
    	@DEL "$(Release_PCH).@"
    	@DEL "Release\_precompile.obj.@"
    
    .rc{Debug}.res:
    	@ECHO.>"$*.res.@"
    	$(RC) /Fo$@ $(Debug_INCS) $<
    	@DEL "$*.res.@"
    
    .rc{Release}.res:
    	@ECHO.>"$*.res.@"
    	$(RC) /Fo$@ $(Release_INCS) $<
    	@DEL "$*.res.@"
    
    !IFDEF BLACKLIST
    
    Debug\$(BLACKLIST).obj: $(BLACKLIST).cpp
    	@ECHO.>"$*.obj.@"
    	@ECHO.>"$*-dummy.cpp"
    	$(CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /Y- /Fo$@ /c "$*-dummy.cpp"
    	@DEL "$*-dummy.cpp"
    	@DEL "$*.obj.@"
    
    Release\$(BLACKLIST).obj: $(BLACKLIST).cpp
    	@ECHO.>"$*.obj.@"
    	@ECHO.>"$*-dummy.cpp"
    	$(CPP) /nologo $(Release_CFLAGS) $(Release_INCS) /Y- /Fo$@ /c "$*-dummy.cpp"
    	@DEL "$*-dummy.cpp"
    	@DEL "$*.obj.@"
    
    !ENDIF
    
    !IFDEF FD
    
    !IF [IF NOT EXIST $(FD) EXIT 1] == 0
    !IF [$(FD) --objectextension=pch -q -O Debug CvGameCoreDLL.cpp > depends] != 0 || \
        [$(FD) --objectextension=obj -q -O Debug $(SOURCES) >> depends] != 0 || \
        [$(FD) --objectextension=pch -q -O Release CvGameCoreDLL.cpp >> depends] != 0 || \
        [$(FD) --objectextension=obj -q -O Release $(SOURCES) >> depends] != 0
    !MESSAGE Error running fastdep.
    !ENDIF
    !ELSE
    !IF [ECHO "fastdep.exe" NOT FOUND! && \
         ECHO Please edit Makefile to reflect the correct path of fastdep. && \
         ECHO. ]
    !ENDIF
    !ENDIF
    
    !ENDIF
    
    !IF EXIST(depends)
    !INCLUDE depends
    !ENDIF
     
  17. Lemon Merchant

    Lemon Merchant Forum Buzzkill Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,409
    Gender:
    Female
    Location:
    Red Sector A
    If you're using a 64 bit version of Windows, you must use the directory "C:\Program Files (x86)\..." in your make file. The Visual C++ Toolkit is a 32 bit program and installs in the 32 bit folder.
     
  18. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,182
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    Yeah, about that, is there any way I can move all those random Microsoft folders to my HDD (D:)? They're currently clogging up my SSD (C:, which, by the way, has a Program Files and a Program Files (x86), whereas for my HDD I simply have a Program Files HDD), but I never got the option to choose an install directory.

    Also, thank you! I'll do all those changes, though after reinstalling / moving those Microsoft things, if at all possible. I do, however, have Boost and Python folders.
     
  19. CaterpillarKing

    CaterpillarKing Conqueror of Cacoons

    Joined:
    Feb 11, 2014
    Messages:
    6,312
    Location:
    On a leaf
    I used the 2008 express but it said that the sln file was made by a new version and couldn't be used. I used 2013 and it just wouldn't load. I used CodeBlocks' compiler but it didn't load there either. Help please.
     
  20. Zlatko

    Zlatko CIW

    Joined:
    Apr 1, 2010
    Messages:
    713
    Location:
    Solar System
    I used Microsoft Visual Studio 2010.
     

Share This Page