Announcement

Collapse
No announcement yet.

COMPILE: Getting the source to compile

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

  • Well, for the databases the alternative solution would have been to make sure that the newdb directory is listed before the database directory in the additional include directories.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • Originally posted by Martin Gühmann

      In that case you should go some posts back :

      So you see the lib folder is included.
      That is how mine looks (plus many other folders), see attached picture.
      Attached Files
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • Originally posted by Maquiladora
        That is how mine looks (plus many other folders), see attached picture.
        No, I mean something else: In the menu bar there you have Projects > ctp2-properties (or however it is called in the English version). There in the right panel you have Configuration Properties > C/C++ > General on the right hand you have then the Additional Include directories, which start with ..\os\include\.

        -Martin
        Civ2 military advisor: "No complaints, Sir!"

        Comment


        • Originally posted by Martin Gühmann

          No, I mean something else: In the menu bar there you have Projects > ctp2-properties (or however it is called in the English version). There in the right panel you have Configuration Properties > C/C++ > General on the right hand you have then the Additional Include directories, which start with ..\os\include\.
          Do I need to include the four folders you mentioned above, and in that order, at the top of the list? I just tried that and it made no difference, I still got the 1 link dinput.lib error. Obviously it still seems to be asking for a file that I don't have anywhere on my PC.
          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
          CtP2 AE Wiki & Modding Reference
          One way to compile the CtP2 Source Code.

          Comment


          • Originally posted by Maquiladora
            Do I need to include the four folders you mentioned above, and in that order, at the top of the list? I just tried that and it made no difference, I still got the 1 link dinput.lib error. Obviously it still seems to be asking for a file that I don't have anywhere on my PC.
            Actually I was talking about something else. For the dinput.lib, Microsoft removed it from DirectX and we are left with dinput8.lib, unfortunately those aren't the same, so just replacing them may cause some problems.

            At least I know that the file is part of my DirectX distribution. Probably we have also to check whether we really need this file, or can replace it.

            -Martin
            Civ2 military advisor: "No complaints, Sir!"

            Comment


            • Originally posted by Martin Gühmann

              Actually I was talking about something else. For the dinput.lib, Microsoft removed it from DirectX and we are left with dinput8.lib, unfortunately those aren't the same, so just replacing them may cause some problems.

              At least I know that the file is part of my DirectX distribution. Probably we have also to check whether we really need this file, or can replace it.
              Should I just go ahead and get an earlier DXSDK then?

              I have the Microsoft link for the same one as you. Oct 2006?
              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
              CtP2 AE Wiki & Modding Reference
              One way to compile the CtP2 Source Code.

              Comment


              • Originally posted by Maquiladora
                Should I just go ahead and get an earlier DXSDK then?

                I have the Microsoft link for the same one as you. Oct 2006?
                Well, that was it that I had in mind. Actually, it isn't nice to download something big like that but if you dare to download Cradle 2, well then it doesn't seem to be such a problem.

                -Martin
                Civ2 military advisor: "No complaints, Sir!"

                Comment


                • Originally posted by Martin Gühmann

                  Well, that was it that I had in mind. Actually, it isn't nice to download something big like that but if you dare to download Cradle 2, well then it doesn't seem to be such a problem.
                  I have 4 different versions of DXSDK now

                  Well I installed Oct 2006 DXSDK and it all compiled without errors. But my ctp2.exe is only 3.79MB, but the last release is 4.92MB. I guess this is because the last release was compiled with VC6?

                  My ctp2.exe also freezes when I build my first city. Everything seems fine (I only tried for 50 turns) when I attach and watch the AI though.
                  Last edited by Maquiladora; August 9, 2008, 22:35.
                  Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                  CtP2 AE Wiki & Modding Reference
                  One way to compile the CtP2 Source Code.

                  Comment


                  • Originally posted by Maquiladora
                    Well I installed Oct 2006 DXSDK and it all compiled without errors. But my ctp2.exe is only 3.79MB, but the last release is 4.92MB. I guess this is because the last release was compiled with VC6?
                    Yes, that's the difference.

                    Originally posted by Maquiladora
                    My ctp2.exe also freezes when I build my first city.
                    How long is the freeze?

                    Originally posted by Maquiladora
                    Everything seems fine (I only tried for 50 turns) when I attach and watch the AI though.
                    Then you should play longer, I usually test the AI for 200 turns this way, and then I see that suddenly the AI stops to tasks its units, and this is definitely different from a VC6 version.

                    -Martin
                    Civ2 military advisor: "No complaints, Sir!"

                    Comment


                    • Originally posted by Martin Gühmann

                      How long is the freeze?
                      About 30 seconds then it crashes with this crash.txt:

                      Version 2008-08-10
                      0x005a3708 [?SetActionFuncAndCookie@aui_Control@@QAE?AW4AUI_ER RCODE@@P6AXPAV1@IIPAX@Z1@Z + 0x8]
                      Then you should play longer, I usually test the AI for 200 turns this way, and then I see that suddenly the AI stops to tasks its units, and this is definitely different from a VC6 version.
                      I watched a 3 AI game on a small map for 200 turns but they were all still moving, slaving etc, but perhaps I can't notice the exact problem.

                      When I detached the AI and tried to open the city manager I get the same error as above. Perhaps I haven't included all the files I'm supposed to? What files exactly do I need from the project I compiled?
                      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                      CtP2 AE Wiki & Modding Reference
                      One way to compile the CtP2 Source Code.

                      Comment


                      • Originally posted by Maquiladora
                        About 30 seconds then it crashes with this crash.txt:
                        Looks like you stumbled across the first thing you have to debug. For that you have to build a debug version. To do this go the menu bar -> Build -> Configuration Manager, there set the active configuration to Debug. Then go to the menu bar -> Project -> ctp2 properties. There go to configuration properties and then Debugging. Add to the program options or program arguments or however it is called nonexclusive. This is needed so that the debugger has any use to you.

                        Then compile and run the program with the debugger for that you have to start the program with F5 for instance.

                        Now test whether the problem occurs also in debug mode. If yes, the debugger gives you the exact position in the code where the program failed.

                        I think at this point you may just explore the debugger a little bit, so that you get familiar with. You may also find a this pointer that is pointing to zero. If you find something like this than you have found a problem. If not the problem is somewhere else.

                        Originally posted by Maquiladora
                        I watched a 3 AI game on a small map for 200 turns but they were all still moving, slaving etc, but perhaps I can't notice the exact problem.

                        When I detached the AI and tried to open the city manager I get the same error as above. Perhaps I haven't included all the files I'm supposed to? What files exactly do I need from the project I compiled?
                        Well, I use for testing 10 players and the Barbarians, and also a map sized one below gigantic, that has some sea on it.

                        -Martin
                        Civ2 military advisor: "No complaints, Sir!"

                        Comment


                        • Originally posted by Martin Gühmann

                          Then compile and run the program with the debugger for that you have to start the program with F5 for instance.

                          Now test whether the problem occurs also in debug mode. If yes, the debugger gives you the exact position in the code where the program failed.
                          I got 98 warnings with ctp2 when compiling the debug version, I've attached the build log but its stuff like this:

                          c:\ctp2\ctp2_code\gs\gameobj\player.cpp(2031) : warning C4244: '*=' : conversion from 'double' to 'sint32', possible loss of data
                          I got no errors that stopped it compiling though so I tried the debugger, but when I try to run it says it can't find MSVCRTD.dll and can't run it. I searched my whole HDD for the file but couldn't find it, so I downloaded it and installed it in windows\system32. Now the debugger runs and... the human settling problem isn't there with the debug version.

                          I should say here, when I first tried the final version I had compiled, I copied the 4 mapgen files, ctp2.exe and ctp2.map to my regular AE CtP2 install and then tried it. I didn't try it from where it was compiled.

                          I just tried the final version again now but this time left ctp2.exe, ctp2.map, and the mapgen files where they were compiled (and copied all other dlls like mss32.dll etc so it would run from the source folder) and the human settling problem disappeared. So what files did I forget to copy when I tried it from my normal AE folder? And should I continue to test any versions I compile from the source folder and not copy them anywhere?

                          In summary, the version I compiled now works (except the AI stopping tasking it's units, although I haven't spotted that yet), debug and final versions, so I no longer need to debug anything, for the moment.

                          However I would still like the fix the warnings I get compiling the debug version, for the future.
                          Attached Files
                          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                          CtP2 AE Wiki & Modding Reference
                          One way to compile the CtP2 Source Code.

                          Comment


                          • Originally posted by Maquiladora
                            I got 98 warnings with ctp2 when compiling the debug version, I've attached the build log but its stuff like this:
                            98 warnings so what? Go to menu bar -> ctp2 project properties -> configuration properties -> C++ and set the warning level to level 4. Then you get a lot of warnings.

                            Originally posted by Maquiladora
                            However I would still like the fix the warnings I get compiling the debug version, for the future.
                            Of course we would like to remove them, but there are other things to do.

                            Originally posted by Maquiladora
                            I should say here, when I first tried the final version I had compiled, I copied the 4 mapgen files, ctp2.exe and ctp2.map to my regular AE CtP2 install and then tried it. I didn't try it from where it was compiled.

                            I just tried the final version again now but this time left ctp2.exe, ctp2.map, and the mapgen files where they were compiled (and copied all other dlls like mss32.dll etc so it would run from the source folder) and the human settling problem disappeared. So what files did I forget to copy when I tried it from my normal AE folder? And should I continue to test any versions I compile from the source folder and not copy them anywhere?
                            Looks like you had copied everything needed. But maybe there is a file in the target whose version the newly compiled executable doesn't like or whatever.

                            For testing the game, you start it of course from Visual Studio, or do you want to copy always the executable, even if you just have changed a tiny code line?

                            -Martin
                            Civ2 military advisor: "No complaints, Sir!"

                            Comment


                            • 2. Use custom build rules

                              Select a .cdb file, right-click, select Properties. For Configuration Properties|General|Tool, choose CtP2 Database Code Generator from the drop-down list.
                              For .l files, choose Scanner Generator. Fill in the Unique Name part (default "yy" generates lex.yy.c, set to "sc" for sliccmd.l, "dbl" for DBLexer.l, "ldl" for ldl.l) when needed.
                              For .y files, choose Parser Generator. Fill in the Unique Name Part (default: "y" generates y.tab.h + y.tab.c, set to "sc" for sliccmd.y, "ldl" for ldl.y) and Directory (default: not needed, set to "..\\gs\\slic\\" for slic.y and sliccmd.y, "..\\ui\\ldl\\" for ldl.y) when needed.
                              I'm having trouble with this part. I cannot add the "Unique Name Part", the box is grayed out.
                              "

                              Comment


                              • Originally posted by EPW View Post
                                I'm having trouble with this part. I cannot add the "Unique Name Part", the box is grayed out.
                                I assumed you only needed to try that if your .cdb files were not generating correctly. And I fixed my problems with those by removing the old database files.

                                I can't fill in the Unique Name Part either, but the whole project compiles with 0 errors or warnings anyway.
                                Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                                CtP2 AE Wiki & Modding Reference
                                One way to compile the CtP2 Source Code.

                                Comment

                                Working...
                                X