Installing and using the SDK

Ah, these ops did it: "/SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF"
 
i am having trouble getting the platform sdk to work it keeps popping up this msiexec.exe it encoutnered a problem and needs to close if anyone can help me get this thing running i be a happy camper over here
 
What OS are you running? Have you tried downloading the Setup program again?

Perhaps you can use the incremental download installer?

What I should say is that I download the incremental version of the Platform SDK, so there is a first part that installs the rest? Since I do not know what version you are using, I hestitate to give a link -- I am using the April 2005 Platform SDK and not the new one -- April 2006 version.

April 2005 version Incremental download:
http://www.microsoft.com/downloads/...8F-A770-45F1-86F3-7AB010B398A3&displaylang=en


So, when it downloads there should be a program on your computer (if Windows 2K or Windows XP) that may be used -- like a configure program for your computer.

Version 2 should be on your computer unless you probably are using Windows XP which has its own version that came with it. It would be similiar perhaps to this program (since this is a newer version especially for Windows 2K):

http://www.microsoft.com/downloads/...70-B259-4733-A914-A956122E08E8&displaylang=en

That above program should be on your computer, but it is also possible that the download is corrupt and will not install, so you would have to download it all again.
You see msi -- exec encountered a problem (which probably sound like Windows XP), so the letters "msi" are the key perhaps.
Anyway that link is for a mutli language version, but there are other links also at the bottom of the page.

That program it sounds like has encountered an error, so perhaps the Download is Corrupt and all of it needs to be downloaded again.
But you could try first the newer Windows Installer listed in the link. It is way smaller in size.
 
tdphippsii said:
i am having trouble getting the platform sdk to work it keeps popping up this msiexec.exe it encoutnered a problem and needs to close if anyone can help me get this thing running i be a happy camper over here

Do you have codeblocks as thats the program you will need to use the platform sdk?
 
thanks raion that got it to work i can't believe i had to download all those to make it work but it did
 
Well, that is just the Platform SDK from Microsoft. To do Direct X, I think it is even larger to download the Direct X SDK (Software Development Kit) which is what is used by everything to make a program in the first place. Especially the Platform SDK. But for something that has been programmed already using a certain version like for the Civ IV game, the correct version is always better to use, since there are two parts to the game -- the part we can play with and the CivIV.exe file which runs the game. We don't have both parts to change and play around with -- Firaxis has to do that to update it to anything like Microsoft has done with anything 2005.NET or 2005 in the title of the software. 2003 version is good enough for me, since I actually am back with the 2002 (2001) version which since Microsoft changed all of those versions will not work for the game.
Enough rambling on, since Microsoft is the one changing everything around due to Security, but in a game such as Civ IV, that is not really needed. But any other program for the Internet or regular programs may need an update. Firaxis has to use the new software first, before we can play around with what the CvGameCoreDLL.dll file is -- an extension used by the core program to add functionality to the game through the Python and XML programming.
I just have to download the segmented part of the Platform SDK, although another link has the full SDK to download all at once. I have a slow connection, and a fast connection is needed for the size that it is.
 
Okay, I see the difference there. So I made a CvGameCoreDLL.dll file that was 3756kB that is 136kB bigger than the 3620kB that came with the game. It works to, and was set to Maximize Speed. Take out the debug stuff and file, it is not needed for the Final Release.

Then I changed the read-in of the Game's Project File (*.vcproj) by selecting the menu item in Codeblocks -> Project -> Property Settings (or Page whatever it is) and made a Minimized file - by setting the "/O2" setting to "/O1" in that file and changing the Compiler setting for the Final Release and Build Options there. That file is 3132kB, but I have not tried it yet. The other file works fine, but I see up above to change those other Settings, and wonder how that got into the Project file in the first place. Oh well.

The files work fine, but leaving that /debug option in the Linker and the file name instead of just /INCREMENT:NO makes the compile crash. It runs out of room in the Toolkit 2003 trimmed down compiler given with that program, I guess.
That will make it kind of hard to get any debugging on anything I might try, but also from what I seen with some of it, I do not need to know.
Turning off the /debug anything, just makes it all look better as it goes down the list of *.cpp files and then finishes up, and it is --->>> Done.
:D
 
Debugging without a debugger is easy, just a lot of work.

Exceptions need to be properly documented and need to send the info to a place you can read it (a log file or even an in game text screen).

By the way, Exceptions are not enabled in the SDK project so they might not work!

Another thing to do is to add code instrumentation.
Code instrumentation predates exception handling and is basicly the daddy of exception handling. You write in lines of code to keep track of suspicious values, tell you when you enter and exit functions, inform you when key variable values have been hit, etc. All the kind of things you can do with exceptions.

#ifdef is a good way to include this code for "pseudo-debug" build and not include it in Release build.
 
Oh yeah,
And don't forget that you can write a test-framework of drivers and stubs that can simulate a series of reasonable and unreasonable inputs and watch for reasonable and unreasonable outputs.

Drivers - the code that simulates the inputs (function call values).
Stubs - the code that simuletes other code that is not finished or not connected for the sake of the testing.
 
Suchy_63 said:
You are right, it crashed for me too.

Maybe Platform SDK is not included in Express edition. In fact I think downloaded version is better to use because it is the latest update, I just didn't get around to install one.

I got it past the loading screen building with vc 2005. Unfortunately it crashes during game setup now (trying to create the first settler unit).

I had to change the compiler option: treat wchar_t as native type to no:
/Zc:wchar_t-

I also installed the .Net 1.1 framework sdk, unsure if that was necessary to the fix or not.

It produces a dll of the same size as the default sdk, and will go so far as generating a map, but crashes with an error in:

// iterate from the current position and return the next item found or NULL when done
template <class T>
T* FFreeListArrayBase<T>::nextIter(int* pIterIdx)

when it tries to generate a settler unit.

I figured I'd share this info in the hope that this will help somebody else figure things out the rest of the way.
 
Hello all,

I have problems making the SDK compile.
I did everything the way Kael posted except I used the new version of the Platform SDK.
(Windows® Server 2003 R2 Platform SDK)

Build log:
<compiles nicely>
...
Linking dynamic library: ..\Assets\CvGameCoreDLL.dll
Creating library ..\Assets\CvGameCoreDLL.lib and object ..\Assets\CvGameCoreDLL.exp
CyMapInterface.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z)
CyInfoInterface1.obj : error LNK2019: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z) referenced in function "public: __thiscall boost::detail::shared_count::shared_count<class CvInfoBase *,struct boost::python::converter::shared_ptr_deleter>(class CvInfoBase *,struct boost::python::converter::shared_ptr_deleter)" (??$?0PAVCvInfoBase@@Ushared_ptr_deleter@converter@python@boost@@@shared_count@detail@boost@@QAE@PAVCvInfoBase@@Ushared_ptr_deleter@converter@python@2@@Z)
CyInfoInterface2.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z)
CyInfoInterface3.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z)
CyMapGeneratorInterface.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z)
..\Assets\CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
Process terminated with status 1 (2 minutes, 46 seconds)
6 errors, 0 warnings

I must confess that these are my first steps into the Civ SDK. I don't know much about its internals (yet). I already learned that boost is the python engine used by civ. Are there known problems with different versions? Did I miss some compiler settings?
I'm programmer, but my c++ is a bit rusty.

Thanks, Albert
 
Hello,

I may have been misleading in my post earlier.

Exceptions are not enabled in the default SDK project (I forgot) so I would assume they will not work!

Make sure you open the vcproj in CodeBlocks. That will set up many of the proper settings.

Follow the rest of the instructions at the beginning and you should be alright.

 
chrusion said:

Make sure you open the vcproj in CodeBlocks. That will set up many of the proper settings.

Follow the rest of the instructions at the beginning and you should be alright.
Maybe I have not been clear in my previous post. I did everything exactly the way described in the first post of this thread.
I installed Civ SDK, Platform SDK, VC Toolkit and Codeblocks.
I opened vcproj in codeblocks, changed the directory and lib settings, flags and options as described.
Then I saved the codeblocks project file and made a build, with the result above.

If the exceptions have to be turned off, how could this be done? I tried to set BOOST_NO_EXCEPTIONS manually but it did not work.

Albert
 
It works! And I have no clue why :crazyeye:
I found that exception handling in boost is controlled by BOOST_NO_EXCEPTIONS, which is on if _CPPUNWIND is not set. The latter relates to the -GX option, so I checked it and found it turned off. I turned it on and voila.
Can anyone tell me what the heck I did?
Anyway...:D
 
Nope, I can not. Each Platform SDK is different, and between the new one and the old one are fixes done by microsoft. I would use the old one, which is April 2005 Platform SDK, it is the same one used by the game.

If you read about it, Microsoft tells what is done with each one. Anyway the new one may work with Windows 2000, but it is not stated, but the old one works with both OS's XP and 2K.

As for Visual C++ Express 2005, no one has gotten it to work with the game. Remember Microsoft is going through security fixes, and they are included in the 2005 whatever it all is versions of anything. None of that probably will be compatible with the 2003 versions. Afterall, it sure is not compatible with the 2002 version of Visual Studio.NET, because some Templates are used before they are declared in some form that gives an error when attempting to build the *.dll file. So, again the programming has changed between all versions, so 2003 is safe, and the others probably will not work.
 
I got it to work with VC++ 2005 Express! Well, not exactly - it still uses VC++ 2003 Toolkit to compile and link, but now I can tinker with the SDK in the VC++ 2005 IDE.

Instructions:

1) Do steps 1-3 in Kael's first post.

2) Install Visual C++ 2005 Express edition or any other edition.

3) Do NOT try opening the existing project file in VC++ 2005. Instead, run VC++, go File->New->Project. Select General of the left-side, then Makefile Project on the right. Enter the parent directory of the location that you extracted the SDK to. For me, this was "D:\Games\Civilization 4\Assets\". Then type in the directory name of the location. For me, this was "CvGameCoreDLL_vc2k5". Click OK.

4) The Makefile Application Wizard should pop up. Click next. Clear all the textboxes for now. Click Finish.

5) Download and extract the attached makefile to the project directory. This makefile is based off a makefile exported from CodeBlocks.

6) Open up the makefile in wordpad or another text editor that understands Unix text files (not notepad). Change TOOLKIT to the path of your Visual C++ Toolkit 2003 directory. Change PSDK to the path of your Microsoft Platform SDK. That should be the only settings you need to mess with. Save and exit.

7) Back in VC++, in the Solution Explorer window, right-click the project->Add->Existing Item. Select all the files and folders in the SDK and click OK.

8) Right-click the project again->Properties. Click on Configuration Manager. Click on the Active solution configuration dropdown and select edit. Remove Debug, and rename Release to Final_Release. Click Close. In the table below, click the cell under Configuration and select Edit. Remove Debug, and rename Release to Final_Release. Click Close. Make sure Final_Release is selected. This should ensure no bogus Debug and Release directories are created when building the project. Click Close to return to project properties.

9) Select NMake on the left side. For Build Command Line, enter "nmake Final_Release". For Rebuild All Command Line, click the ".." button, then enter the two lines "nmake clean_Final_Release" and "nmake Final_Release" one after another, then click OK. For Clean Command Line, enter "nmake clean_Final_Release". The Output box doesn't matter at all - you can clear it if you want to. Click OK.

10) Make sure you project is selected and click the Build Project or Build Solution button (or go Build->Build Solution or Build->Build <project>, or right-click the project and select Build).

And that should do it!

Note: I changed the location where the dll is created to "Final_Release" instead of "..\Assets". You can change this in the makefile by going down to the "### The targets of this project" section and changing all the paths there.
 

Attachments

  • Makefile.zip
    10.2 KB · Views: 1,355
I can't get the Platform SDK to install. I can't use Internet Explorer to install it automatically, because I need to use it on a computer that isn't connected to the internet. The .exe comes up with a message saying that I don't have access rights to it (which is strange) and to verify that the installer exists (erm...). Additionally, this platform SDK seems to be for Windows Server 2003 - so should I be installing it on Windows XP Pro?
 
zulu9812 said:
I can't get the Platform SDK to install. I can't use Internet Explorer to install it automatically, because I need to use it on a computer that isn't connected to the internet.

Did you try SP1 or R2 version? I can describe what worked for me:
I downloaded the new version Platform SDK R2 full download. It comprises of 18 files PSDK-FULL.1 - 17.cab + PSDK-FULL.exe you have to download seperately.
The exe is a selfextractor with two files (extract.exe, PSDK-FULL.bat) you extract into the same folder your .cab files are in. Then you call the .bat to merge the downloaded files (into /temp).
Now you have a setup.exe, autorun.inf, and three folders images, licence and setup. Burn this stuff on CD to get an installation CD for the SDK.
setup.exe should install the Platform SDK (provided you have admin rights)
into a folder of your choice.

MS site says it should work with all platforms from MS Server 2003 through XP Home. I have XP Pro.
 
Top Bottom