A simple guide to compiling the DLL

I have got to

How to compile

Open Visual C++ 2008 which you've installed in step 1. In it, open (File->Open->Project/Solution) the CvGameCoreDLL.sln file inside the CvGameCoreDLL folder.
On the top of the window (below the menu) you will see a drop-down box with either 'Debug' or 'Release' in it. These are the two configurations in which you can compile

but I have no .sin file inside the CvGameCoreDLL folder. Was that path suppose to lead me to the folder with the makefile and where I dropped all the cv files from "archive of the BTS 3.19 source files" in step 6?
 
Was that path suppose to lead me to the folder with the makefile and where I dropped all the cv files from "archive of the BTS 3.19 source files" in step 6?

Yup. If it isn't, you're looking in the wrong folder.
 
OK I followed the instructions and it complied a dll and I guess it complied it in the release folder? But how do I edit an already edited CvGamecoreDLL.dll? I couldn't find an un compile dll option. This guide only works created a new dll?
 
You can't edit a DLL. You have to edit the .cpp and .h files and then compile. To edit an already-compiled DLL go find the source files it was compiled from and edit those, then compile again.
 
You can't edit a DLL. You have to edit the .cpp and .h files and then compile. To edit an already-compiled DLL go find the source files it was compiled from and edit those, then compile again.

Oh I didn't know it wasn't like python/xml where I could open it and edit and save. So I start with the base SDK(correct term?)edit the .cpp and .h to my liking and then compile.
 
OK can I uncompile a .dll so I have all those .cpp and .h files to edit? I want to merge 2 modified .dll and add traits
 
Oh I didn't know it wasn't like python/xml where I could open it and edit and save. So I start with the base SDK(correct term?)edit the .cpp and .h to my liking and then compile.

Yup exactly.
 
OK can I uncompile a .dll so I have all those .cpp and .h files to edit? I want to merge 2 modified .dll and add traits

No, you have to find the SDK files the DLL was compiled from. Usually they come with the mod in a folder called "SDK" or something like that. If not, they might be in a separate download in the downloads database. If they're not there anywhere then you're out of luck, sorry. You could try PMing whoever made it and see if they have the source files.
 
No, you have to find the SDK files the DLL was compiled from. Usually they come with the mod in a folder called "SDK" or something like that. If not, they might be in a separate download in the downloads database. If they're not there anywhere then you're out of luck, sorry. You could try PMing whoever made it and see if they have the source files.

That's great. I know more than walking into this :)

OK I found the Icebreaker .dll and just use that as my base to allow more civs.
Does BUG alter the cvgamecoredll.dll? because I like there menus
 
I think so...not sure. If it does, allowing more civs is pretty easy, just one line in cvdefines.h, may not need icebreaker
 
You have 5 mods linked, so which one is it?
 
I think I can help if I have more information.

I see "im running the game under pure kmod core without my added stuff. ". So you are just running kmod? Perhaps you should ask the kmod people about why it does not work.

If that does not work I would need access to your repository and a procedure to reproduce.
 
with kmod - it works fine -last time i checked.

i guess either python or sdk stuff are causeing the problem.

kmod it self is great and stable.

i will upload you all you need , dll core, nmake, project, debug file and all there is.

im running autoai play till i get the crash.

i pray that youll help me!
ill do anything!
 
So you get to play it some. That was not obvious.

I can have a look at it on Thursday. Have you generated a crash dump and seen if it gives you any insight?
 
I'm getting the exact error below, but for the life of me can't figure out what's wrong. I've done some searching around, and it looks like the problem could be that I'm missing a Boost-1.32.0\ folder that should be included in the SDK, but for some reason isn't. I've double checked all the files in my bts install and in the original post of this thread, but can't seem to locate it anywhere.

#### Paths ####
TOOLKIT=D:\Civproject\Microsoft Visual C++ Toolkit 2003
PSDK=D:\Civproject\WindowsSDK
CIVINSTALL=D:\Civproject\bts\Beyond the Sword
GLOBALBOOST=$(CIVINSTALL)\CvGameCoreDLL\Boost-1.32.0
GLOBALPYTHON=$(CIVINSTALL)\CvGameCoreDLL\Python24

I tried to make things easier on myself by copying all the included directories to the same spot, as seen in the screenshot. Any advice on what I might have typed in wrong?

I've followed the instructions but it failed to compile (I haven't changed even any file). Here's the Output Window of BuildLog:
Code:
Performing Makefile project actions
 "C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /Zi /Od /D_DEBUG /RTC1 /Fp"Debug\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /IBoost-1.32.0/include /IPython24/include /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003/include" /I"C:\Program Files\WindowsSDK/Include" /I"C:\Program Files\WindowsSDK/Include/mfc" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Python24/include" /YcCvGameCoreDLL.h /Fo"Debug\_precompile.obj" /c _precompile.cpp
_precompile.cpp
c:\Program Files\CvGameCoreDLL\CvGameCoreDLL.h(160) : fatal error C1083: Cannot open include file: 'boost/python/list.hpp': No such file or directory
NMAKE : warning U4010: 'Debug\CvGameCoreDLL.pch' : build failed; /K specified, continuing ...
 "C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /Zi /Od /D_DEBUG /RTC1 /Fp"Debug\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /IBoost-1.32.0/include /IPython24/include /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003/include" /I"C:\Program Files\WindowsSDK/Include" /I"C:\Program Files\WindowsSDK/Include/mfc" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Python24/include" /FoDebug\CvArea.obj /c CvArea.cpp
CvArea.cpp
CvArea.cpp(3) : fatal error C1083: Cannot open precompiled header file: 'Debug\CvGameCoreDLL.pch': No such file or directory
NMAKE : warning U4010: 'Debug\CvArea.obj' : build failed; /K specified, continuing ...
and something like that for 90000 characters. What have I done wrong?
 

Attachments

  • bts paths.PNG
    bts paths.PNG
    18.2 KB · Views: 166
Hello,

I have been trying to follow this guide, and I have gone through all the steps, but no matter what I do, the game crashes using the compiled DLL. I am currently compiling the DLL having edited none of the source code, and I have tried it with the source that came with my copy of the game and the source posted here.

The game will start with the DLL loaded just fine, but will hang at the loading screen before starting a game for some time before crashing at "Init Graphics"

When the program is run with VS2008 debugging it, VS2008 displays the following callstack:

Code:
LoadCivXml (xml\Terrain/CIV4TerrainSettings.xml)
LoadCivXml (xml\Interface/CIV4ThroneRoomCameraInfos.xml)
LoadCivXml (xml\Interface/CIV4ThroneRoomInfos.xml)
LoadCivXml (xml\Interface/CIV4ThroneRoomStyleInfos.xml)
LoadCivXml (xml\Events/CIV4EventInfos.xml)
LoadCivXml (xml\Events/CIV4EventTriggerInfos.xml)
LoadCivXml (xml\Art/Civ4RouteModelInfos.xml)
LoadCivXml (xml\Misc/CIV4RiverInfos.xml)
LoadCivXml (xml\Art/CIV4RiverModelInfos.xml)
LoadCivXml (xml\Misc/CIV4WaterPlaneInfos.xml)
LoadCivXml (xml\Misc/CIV4TerrainPlaneInfos.xml)
LoadCivXml (xml\Misc/CIV4CameraOverlayInfos.xml)
LoadCivXml (xml\GameInfo/CIV4ProcessInfo.xml)
LoadCivXml (xml\GameInfo/CIV4EmphasizeInfo.xml)
LoadCivXml (xml\Units/CIV4MissionInfos.xml)
LoadCivXml (xml\Units/CIV4ControlInfos.xml)
LoadCivXml (xml\Units/CIV4CommandInfos.xml)
LoadCivXml (xml\Units/CIV4AutomateInfos.xml)
LoadCivXml (xml\GameInfo/CIV4VoteInfo.xml)
LoadCivXml (xml\Interface/CIV4CameraInfos.xml)
LoadCivXml (xml\Interface/CIV4InterfaceModeInfos.xml)
LoadCivXml (xml\Units/CIV4FormationInfos.xml)
LoadCivXml (xml\Misc/CIV4AttachableInfos.xml)
LoadCivXml (xml\GameInfo/CIV4DiplomacyInfos.xml)
LoadCivXml (xml\Misc/Civ4QuestInfos.xml)
LoadCivXml (xml\Misc/Civ4TutorialInfos.xml)
LoadCivXml (xml\GameInfo/CIV4EspionageMissionInfo.xml)
The thread 'Win32 Thread' (0x73ec) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x6b20) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x70cc) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x689c) has exited with code 0 (0x0).
First-chance exception at 0x00479fd0 in Civ4BeyondSword.exe: 0xC0000005: Access violation writing location 0x43b31000.
Unhandled exception at 0x00479fd0 in Civ4BeyondSword.exe: 0xC0000005: Access violation writing location 0x43b31000.

Again, this DLL is being compiled from the unedited source, but, despite this, the final Release DLL is ~15 KB smaller than the one which comes with the game leading me to believe something is going wrong in the compile.
 
Top Bottom