No announcement yet.

Compiling the SDK

This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by Sir Ralph

    Boost is a pretty common class library. You can't simply change things there, that would be similar to changing things in the standard template library. Around the template in question is a #if/#endif, which limits the compiler version to at most MS C 13.00, while VC++ 2005 has 14.00. If the boost developers (which are NOT Firaxis) did this, and even named the macro BOOST_WORKAROUND, you don't want to fiddle with it without knowing the consequences for the whole library (which is huge).
    So, apparently the VC2003 issue has nothing to do with Firaxis.

    Tom P.


    • #32
      And after a good look around, I can't figure out how to post a question nmor whom to post it to.

      I've subscribed to the mailing list so we'll see if I can get an answer this way.

      Tom P.


      • #33
        It is probably fixed in their latest release though. Firaxis uses the Boost libraries dated from when they started development on civ4.

        Well, atleast the boost site claims complete vc2005 compatibillity for their recent releases.
        no sig


        • #34
          You're a better man than I am - I couldn't even find that.

          I can't even use the mailing list since it's the "++" part drives hotmail nuts.

          I'll see if gmail handles it better.

          Tom P.
          Last edited by padillah; April 27, 2006, 14:11.


          • #35
            Any one try upgrading Boost.python and compiling in VC 2005?

            I would really like to use VC 2005. I use it at work and am very comfortable with it, as is.

            Oh, well.

            Tom P.


            • #36
              I downloaded the Express version of VisualStudio.NET 2005, then it states you must download (in sections for me) the March 2006 Platform SDK, and then while viewing the advertisement about Express and features, it may have stated that only Console Applications could be made. I hope not, as it is working, but it is for mainly for managed applications, and that makes it not sure for Native Code Applications like this one it is needed for.

              Although it did say Win32 Apps when the Platform SDK is downloaded.


              • #37

                I have installed Boost 1.33.1 but could not get it to generate the boost_python-vc80-mt-1_33_1.lib & .dll
                However, somebody in Russia has these two files (but not the debug versions) available for download. I cannot speak or read Russian but the file name is the same (and they had a lot of Boost library files up there).
                But I still got the same exact error (and warnings)
                I am going to try the method described earlier.


                • #38

                  I edited CyInfoInterface2.cpp (I could see that was the culprit file so Fromafar's solution seemed good) using option one:

                  .def("getUniqueRange", &CvBonusClassInfo::getUniqueRange, "int ()")

                  I choose this option because the name "getUniqueRange" implies a getter function: (I hope there is no setter implementation of this expected in the Python implementations. I guess I should look. Later.)

                  I still needed to add User32.lib to my project library list in my project settings. (winuser.GetKeyState() in a link error required it.)

                  Compile with no errors!

                  I cannot find the DLL that is supposed to have been compiled with zero errors! Well, I will have to look into this later.

                  I forgot to mention that to get the New Boost library to compile with this I changed the project file paths from the relative paths within the Civ SDK folders to a direct path to the Boost 1.33.1 library paths I had only freshly built and installed the other day. (I never took the time to find out why the Python libs and dlls did not get generated by Boost's bjam because I Googled the precompiled lib and dll at the Russian site. These files were placed in the Boost\lib directory.)


                  • #39

                    Found it!
                    Of course it is in the most natural place for me not to look
                    \assets folder!
                    named CvGameCoreDLL_RELEASE.dll


                    • #40
                      most important question: could you start a game succesfully?
                      no sig


                      • #41

                        No, got some Python initialization errors.

                        Had to go to bed for early day.

                        1> My first guess is that the function I edited needs setter functionality.

                        2> The Boost update may have broken the Python.

                        3> I also updated Python so I might have broken it there.

                        I know it is a Big NONO! to push upgrades like that but I am gonna have fun debugging it tonight!


                        • #42
                          Ah, I think the last Platform SDK that will still work with Visual Studio 6 version is Feb. 2003 version, which is the last time that was updated. Perhaps that means that downloading a previous version of the Platform SDK more for VisualStudio.NET 2003 (which had some errors in it) may work and help with VisualStudio 2005 version. Right now, I am not sure of anything, but if the files are older and can be used to compile anything then perhaps that may work.

                          I am not sure if I am talking through my hat here, because to me the code looks like some managed version, which I am not familiar with at all. If it is pure C++ then even the standard libraries and such have been changed to reflect more of the ISO standard (whichever) in VisualStudio 2005 according to Microsoft.

                          Pretty much VisualStudio 2005 is changed all around, while that was still not done with VisualStudio.NET 2003.

                          ?? Have to look into if further to see if one can download an earlier version of the Platform SDK and even if that may have anything to do with it.

                          mmmmmmmmmmmmm...........................have to read and think about that, I guess.


                          • #43
                            I have the latest Platform SDK.
                            I had to specify the User32.lib in my project.
                            I also moved all the PlatformSDK paths upto the top (Above DirectX) in my Options -> Projects_and_Solutions -> VC++_Directories.
                            This last step may have had no effect but it could have.


                            • #44
                              Direct X has to be first otherwise you use the Direct X provided when you installed the program (Visual Studio 2003 or 2005). In earlier versions of some programming program that could have been Direct X 5. That is not what you wanted, so in the Configuration Manager of the program, you add the lines of the PATH first so you use the Direct X version you want to program with. The Default Path may not lead to the files you actually want to use. The Platform SDK may be the same way. Since you install the program and it Defaults to a certain PATH (the path it installs with its own files included in the download), the program sets up a Default Path in the Configuration Manager. That may not be the files that you really want to use, so you have to add the PATH to the correct files. I think it should also work with it that way also the Platform SDK.

                              Afterall, one just uses the files from the Platform SDK from the PATH to use in the Project one is building, and whichever version you use is the version the Project will be built in.

                              In other words, if I wanted to use Direct X 7 in a build, and pointed to the SDK for Direct X 7, then those files will be used. Otherwise, I may point to Direct X version 8 or 9 and then those will be the files that I use. Of course my code would have to reflect that with the programming for the proper Direct X version or Platform SDK version. Since the programming for the game is for Version 7.1, you have to use the Build (compiler) that will Build the CvGameCore.dll file the proper way.

                              I think I will try that, and download the Platform SDK April 2005 version, since I have Visual Studio 2005 Express on my computer now also, and try that. If not I already downloaded the VisualStudio 2003 Toolkit.

                              I know the Project will not open in VisualStudio.NET 2002 version, since I have that, and it states the files are of the 7.1 version.

                              Visual Studio.NET 2002 is Version 7.0
                              Visual Studio.NET 2003 is Version 7.1
                              Visual Studio.NET 2005 is Version 8.0

                              And since they upgrade the Platform SDK (Microsoft bugs), the proper one should be used for the Civ IV game.

                              That means that if I download the April 2005 Version Platform SDK, it may work to build the Project even with Visual Studio 2005, I should hope.

                              Afterall, I have to download it all anyway, and also should download the new one (which is March 2006 or is that April 2006, but they did change Visual Studio 2005, so the March version would work if it was not buggy, thus the now April 2006 version to fix their bugs).

                              One thing I go by is that with the newer versions of the Platform SDK, Windows 2000 is not listed. But with the April 2005 Version, Windows 2000 is listed. I think since the game is for both OS's then the Platform SDK used in the game would have been at least one of the earlier versions, and I will use the one that states it works for Windows 2000 (April 2005 version) which still can be downloaded in Chucks of 25mB which is what I will have to do. (Use full download where it states it can be downloaded in 25mB chunks.)

                              18 files later or so, I will get back to finding out, how it all goes -- someday.

                              Only Microsoft can do all of this to YOU!
                              Spend more time checking Critical Updates, YOU may finally get an OS before Vista comes out.

                              One has to laugh someday to all of it.

                              link to Platform SDK April 2005 version:


                              If not fast connection, use what it says, and use the Full Download link so you can download it in 25mB chunks until done with all of it, and then install the darn thing by itsself in some folder (don't want to change anything else on your system or in your OS perhaps). Then take whatever Visual Studio version program (2003 or 2005) and make the necessary changes in the Configuration Manager to point to that folder, to find the files to use, that make the Compile of the CvGameCore.dll and put the PATH lines first in the Configuration Manager to use those files first instead of the Default Path PATH lines. (Perhaps that will work, I guess I will find out.)

                              In other words, like Direct X, I have a couple of versions of that, and I put (or change) the lines to point to whichever version I will use. (Direct X 8.1 or Direct X 9 - and of course newer versions can also be downloaded.)
                              Of course it is handy to always use the newest version of something like the Platform SDK or Direct X SDK, but if another program is already using a previous version build, the Calls and Programming may be slightly or greatly changed after Microsoft fixes their own BUGS in the darn things, after getting feedback from programmers who say that a certain something does not work correctly. That is why and with the April 2006 version even though Microsoft TRYS to keep things the same, it may not always be able to do that from Version to Version. Afterall they finally gave in to the ISO standard more, since the earlier Versions were not as compliant to that Standard used by just about everyone else.

                              April 2005 Version Platform SDK for chunks (25mB) downloading with a slow connection: (This will take time of course)


                              I think that is the correct one, as stated it works both with Visual Studio 2003 and Visual Studio 2005 and fixed some things.

                              They did not Include 3 Library files that must also be downloaded. But if the Configuration Manager PATH lines for the Program (VS.NET whatever version) points to the correct files, it should find all the files you need, if the Path is correct.
                              If noone minds, those 3 Library files can be downloaded at the link below and wherever you put them and point to them with the Path in the Configuration Manager (which is separated for Lib files, or Directories files or Include files - those famous *.h files to find for windows like - windowsx.h - then I think that will work:

                              Here is the other thread for those now lost completely now: (but it is not all that difficult to understand -- you need to find files, you need to set the Path for the Program to find those files, and then you can probably use Visual Studio 2005 Express to build a version 7.1 file and not a 8.0 version file, since that is what you are trying to do, by using a different Platform SDK download similiar to using a different Direct X version to make a Direct X something depending on whether it be Direct X 7, 8, 8.1, 9, 9.0a, or 9.0b, or 9.0c version whatever):


                              Don't lose the original Path lines in the Configuration for anything since they are put in as Default when you install the program, but then I am assuming that changing all of that will point to the Proper Platform SDK to make this game work with both versions of Visual Studio (2003 and 2005) and then, I guess I will find out if all of this was babbling or it will work in the end. I don't see why it should not. That I guess depends on if the Compiler Files are in the Platform SDK or the program will still Compile it correctly with the way the game was programmed. Crosses fingers because he really does not know, but hopes it will.

                              Ah, I have never tried this, so there is still the possibility that Visual Studio 2005 Express will stamp a Version 8.0 to the files, and that may not work. Well, maybe that can be changed also somewhere, but then again, it is a lot of work just for a game, because in the end Microsoft is the culprit here again. But perhaps that can be done, and then again, I may just be dreaming after all of that work. Such a plan, eh!

                              Afterall of that, a little explanation. The program installs with Default Paths to find certain files. The reason they state to put in the Path to the Version of Direct X you want to use --- first, is that if you do not, it will use the Default Path to find the Direct X version. In some cases that was Direct X Version 5. That is not what was wanted. You wanted to use Direct X Version 8.1, thus the Path for the Configuration Manager has to list them first. So even if you keep the Default Paths in the Configuration of whatever Visual Studio (2003 or 2005) if you put in the Paths to the files you want to use - first, then the program will first go to that Path, and will bypass the Installed Default Path, when the program was installed. This makes it possible to find the files you want to use, and build with those files, and you want to build a 7.1 version file for the game. (Direct X has nothing to do with this, but that is why it is Path that way - so the program can find those files first, and not use the Default Path of where the program (VS.NET) was installed. Those original Default Path files you do not want, put in the correct Path first ahead of the Default Path, and then the program finds the correct files to compile the CvGameCore.dll file with.

                              And it is not an *.EXE file, and should be a *.DLL file because the Project main file should have Saved that, or the file with the .vcproj whatever extension is. Open that, and all is well. Point to the correct files to Build (compile) the file and all is well then.

                              I am tired. Goodday!
                              Last edited by Raion; May 10, 2006, 11:56.


                              • #45
                                I have retreated back to the Boost and Python that came with the SDK.

                                The game loads past the Python initialization now but crashes before going to full screen with an error in a msvc8 dll.

                                I have tried to attach with the debugger to a debug build of the dll and do not see any of the dll in the stack.

                                I have a feeling the new msvc8 compiled into the dll is breaking on msvc71 in the other parts of the game.

                                There may be a way around this but I do not see it yet (except to back track to vc2003)

                                I am at the end of today's work. I'll get on it tomarrow.