Installing and using the SDK

@Flying Pig

It works. You will need to follow the same steps as per Refar's PDF. You will not need to download the PSDK as it comes bundled with VC++ 2008. You should replace the reference to the PSDK folder in the makefile with the one that comes with VC++ 2008.
 
Having a problem with step 7

7: Open \CvGameCoreDLL\CvGameCoreDLL.vcproj in CodeBlocks.

vcproj isn't assigned to anything. It asked me how I wanted to open it, I choose in codeblocks, and it shows up as text, not as a project.

I have removed the assigned vcproj just fine, but it still won't open as a project.

Figured out my error, there were two similar files. I am loading the FFH source.
 
which platform SDK should I use if I'm running Vista x64? Microsoft Platform SDK for Windows Server 2003 R2 won't install - says it's not compatible.
 
EDIT: ugh, I'm an idiot... Just read Refar's sig, duh! ;)

umm...

I had to do an OSRI, and so need to start from scratch again for editing the SDK.

All links for VC++ Toolkit 2003 are dead though, the MSDN doesn't host it anymore. And Googling didn't work either. Could someone upload the file here? Or does anyone have a working link?

Thanks...
 
which platform SDK should I use if I'm running Vista x64? Microsoft Platform SDK for Windows Server 2003 R2 won't install - says it's not compatible.


As it turns out, I can use the platform SDK v6.1 - in order to get it to work I had to factor in a new path for search directories and linker.

From the opening post (my additions in bold):

6: Go to Settings->Compiler in the CodeBlocks menu. Click the "Directories" tab and add the the following directories to the compiler tab (changing to account for where you installed the packages):

Code:
[i]C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include
[B][SIZE="4"]C:\Program Files\Microsoft SDKs\Windows\v6.1\Include
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include[/SIZE][/B][/I]

In the Directories/Linker tab add the following directories:

Code:
[I]C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\lib
[B][SIZE="4"]C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib[/SIZE][/B][/I]
Hopefully that helps some people out
 
Hi. It's been a while since I've been modding Civ IV, and I'm now on a new computer with Vista. I'm using Visual C++ 2008 Express (used 2005 last time, IIRC), and have followed the instructions. Had a couple of errors along the way that I cleared up (I fixed the wrong Makefile, and wound up starting a new project after the first issues).

Unfortunately, I'm now getting an error:

>c:\Users\Space Hamster\Desktop\Civ IV BTS SDK Mods\CvGameCoreDLL\CvGameCoreDLL.h(160) : fatal error C1083: Cannot open include file: 'boost/python/list.hpp': No such file or directory
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x2'

So I tried to use "Add Existing Item..." to include the folder. It doesn't like to include folders. So I started adding in files manually. Now not only does it not give me any message if I add the same file more than once, making me worry about the files with the same name, and not only are there more directories than seems sane (I'm currently at Boost-1.32.0\include\boost\spirit\phoenix, whatever that is), but I'm quite sure that I didn't do this last time. I know it's wrong, but at this point, I feel the need to complete my mission.

So, if someone could let me know what I'm supposed to do, I'll check here again when it fails after all this effort. Thanks!

EDIT: Aargh. There wasn't far to go after that point, and I just realized that when I fixed the wrong Makefile, I fixed the one that I downloaded (in the wrong place). I was using the original on my second try! It seems to be compiling, so wish me luck.

EDIT2: And success!
 
I followed the instructions in the first post and installed code blocks and the SDK and now I want to compile a modcomp. The dll compiles, but at the end of the process I get this error message about the debugger running out of memory. So I disabled the debugger and it still happens.
 

Attachments

  • Debugger.jpg
    Debugger.jpg
    40.3 KB · Views: 222
Vista is a lot pickier than XP. I dont think it has anything to do with codeblocks and is probably a bug in your code that XP ignores.

The classic one is a call on a null object. For example:

Code:
if (gc.getFeatureInfo(pPlot.getFeatureType()).isPermanent())

Will work just fine on XP even if pPlot doesn't have a feature type. Vista crashes when attempting to see if the non-existant feature is permanent.

Ok, so does anybody have an idea on what a modder needs to do in order to make their DLL file "Vista compatible?"

I'm having this issue right now... History in the Making works flawlessly in Windows XP. Vista users get constant CTDs. Since I'm not a seasoned code monkey, I'm not sure exactly what I need to do in order to fix the CTDs.

Any suggestions?
 
I've looked through the entire topic, and found people with the same errors I'm getting, but none of the solutions given solve my problem.
I'm using code::blocks and have followed the instructions in the initial post to the best of my ability.

The first error I get is this:
Code:
cl : Command line warning D4024 : unrecognized source file type 'EHsc', object file assumed
CvGameCoreUtils.cpp
cl : Command line warning D4027 : source file 'EHsc' ignored
And I get this for most if not all .cpp files

I also get this:
Code:
||=== CvGameCoreDLL, Debug Win32 ===|
c:\program files\Microsoft Visual C++ Toolkit 2003\include\memory|498|fatal error C1067: compiler limit : debug information module size exceeded|
||=== Build finished: 1 errors, 0 warnings ===|

Just to make sure I don't get redundant advice, I have changed EHsc to /EHsc, so that isn't the problem.

May be relevant, but I doubt it: I'm using Code::Blocks version 8.02 and Civ IV: Col version 1.01f
 
Concerning the second error you get.. Did you do this:
"On the "Compiler Flags" tab, uncheck "Produce debugging symbols [/Zi]"."

About the first issue.. It still seems that your compiler command lines include EHsc without '/'. To make sure that this is not the case you may look at the makefile that Code::Blocks has created for you. It should be listed in the project's files list.

For an alternative way to build the C4C DLL you may like to look here: http://forums.civfanatics.com/showthread.php?t=294243
I recommend using VS2008 or 2005 because both IDEs are much more powerful than Cod::Blocks while being more user-friendly. Additionally both allow you to debug your DLL which is something you will end-up needing if you intend to do serious SDK changes.
 
[/Zi /D_DEBUG] wasn't checked by default for some reason. Just to be sure, I checked and unchecked it, and I deleted /Zi from the next screen (the "Other options" tab) all when I first attempted to compile the code.
screen.gif


And I can't seem to find the makefile.

EDIT: I found the problem. In the Build menu, under "Select Target >" I had a debug option selected and I'm not sure why. Changed to Final Release and everything is compiling fine so far.
 
I've been banging my head trying to make this work. I can get the "release" to compile, but when I try to compile the final release, it gives me this error:

LINK||fatal error LNK1181: cannot open input file 'Release.obj'|

There is no release.obj file being created, so this owuld be why it can't open the file.

On the plus side, the release file seems to work just fine. Time to let my fans beta test!
 
You no longer need to download the SDK. It is included in every official patch for Civ4, Warlords, and BTS. For Civ4 it is in "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\CvGameCoreDLL". For expansions it is in folders with the same name under the expansion's folder.
 
You no longer need to download the SDK. It is included in every official patch for Civ4, Warlords, and BTS. For Civ4 it is in "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\CvGameCoreDLL". For expansions it is in folders with the same name under the expansion's folder.


Oh, ok... I thought that would be it, but didn't want to deviate from instructions :lol:
 
Ok, I'm all the way to the end, did the BTS fixes that were tacked on, and still get a 'fatal error C1038: cannot open include file: 'windows.h' No such file or directory'

What's the deal with that?
 
I hope you don't actually use notepad...
Use notepad++, it has syntax highlighting for almost any language you could want to use, including C++, Python and XML.
If there is a keyword you are looking for and don't know which file it is in, notepad++ will be able to find every instance of that word or text string in every file in seconds.
The only way I could possibly go without it for Civ modding is if I had Crimson Editor. A program that is almost as good as Notepad++.
 
Back
Top Bottom