Announcement

Collapse
No announcement yet.

COMPILE: Getting the source to compile on VS.NET

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Actual I access my linux home directory from a WinXP computer, and I think it is something like a virtual drive the Z: drive. Z:\Raid\ is actual some another hardrive space provided on the Linux/Unix platform. So it is possible that it runs under a bash. So the only question is now where I have to insert this addition \.

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

    Comment


    • #47
      What does the custom build command say?

      Comment


      • #48
        The custom built command for z:\Raid\Ctp2\ctp2source\ctp2_code\gs\dbgen\ctpdb.l looked like this:

        Code:
        Z:\Raid\CTP2\ctp2source\bin\flex -i -o"$(ProjectDir)"lex.yy.c "$(InputPath)"
        I changed it to this:

        Code:
        Z:\Raid\CTP2\ctp2source\bin\flex -i -o"$(ProjectDir)\lex.yy.c" "$(InputPath)"
        I moved a quotation mark from before the lex.yy.c behinfd the lex.yy.c and put at the original postion of the quotation mark a \.

        I also had to change in the dbgen properties in Linker->General->Enable Incremental Linking from No (/INCREMENTAL:NO) to Yes (/INCREMENTAL).

        With this dbgen links fine.

        Maybe I have also to do it in the main CTP2 project, too.

        Another constum built error for z:\Raid\Ctp2\ctp2source\ctp2_code\ui\ldl\ldl.l was this:

        Code:
        Z:\Raid\CTP2\ctp2source\bin\flex -i -Pldl -o"$(ProjectDir)"..\ui\ldl\lex.ldl.c "$(InputPath)"
        Again changed to:

        Code:
        Z:\Raid\CTP2\ctp2source\bin\flex -i -Pldl -o"$(ProjectDir)..\ui\ldl\lex.ldl.c" "$(InputPath)"
        Another one for z:\Raid\Ctp2\ctp2source\ctp2_code\gs\newdb\DBLexer .l

        I fix it according the same pattern.

        Probably I will find a lot more. So I stop now and report later.

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

        Comment


        • #49
          I it looked like every custom built file is affected, in addition there were ..\ctp2_code\gs\slic\slic.l and ..\ctp2_code\gs\slic\sliccmd.l. And also all the *.cdb files in the ..\ctp2_code\gs\newdb\ folder. Unfortunatly not all of the *Record.* files are rebuilt, I don't have updated stamps of:

          AdvanceListRecord.stamp
          BuildingListRecord.stamp
          BuildListSequenceRecord.stamp
          ImprovememtListRecord.stamp
          UnitBuildListRecord.stamp
          WonderBuildListRecord.stamp

          Than I got such error messages:

          z:\RAID\CTP2\ctp2source\ctp2_code\gs\newdb\BuildLi stSequenceRecord.h(89) : warning C4183: 'Init': missing return type; assumed to be a member function returning 'int'

          That could be fixed by adding the return type to the Init function in RecordDesscription.*, for most of the DB records.

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

          Comment


          • #50
            Here is the modified deque, I think I should replace the ACTIVISION_ORIGINAL stuff by something more appropiate, as this is not Activision code. Another problem with this file is that there are still two problems, but it should fix a bunch of other problems.

            I put it into a separte folder and added this folder to the include file list in front of the MS include file directories.

            Another problem I wasn't able to fix yet is the Scheduler thingy I still don't know into which file I should move.

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

            Comment


            • #51
              Well looks like I attached the wrong file, it wasn't deque, but it is a list-fixed here is the file:

              Well so far no real idea for:
              typedef std::deque > Scheduler_Vector;

              And no idea for tech_wllist.h

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

              Comment


              • #52
                Well I was able to pass the Scheduler problem, I just replaced these lines:

                typedef std::deque > Scheduler_Vector;
                typedef std::deque Scheduler_Vector;

                by:

                typedef std::vector > Scheduler_Vector;
                typedef std::vector Scheduler_Vector;

                In Scheduler.h

                Does anybody see a problem to use a vector instead of deque, are there any problems like access time?

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

                Comment


                • #53
                  Martin,

                  As per Microsoft's C++ Reference:

                  The Standard Template Library (STL) sequence container deque arranges elements of a given type in a linear arrangement and, like vectors, allow fast random access to any element and efficient insertion and deletion at the back of the container. However, unlike a vector, the deque class also supports efficient insertion and deletion at the front of the container.


                  Note the last sentence. So, the replacement of the deque with the vector might slow down the ai scheduling, if they do a lot of pushing and popping, though I imagine if that were the case, a stack might have been better. (Though, of course, underneath it uses a deque any way.)
                  XBox Live: VovanSim
                  xbox.com (login required)
                  Halo 3 Service Record (I fail at FPS...)
                  Spore page

                  Comment


                  • #54
                    Success

                    Don't know if anyone cares now, but I have successfully compiled the game on Visual Studio.NET just now. (That's .net 2002 + sp2, not 2003.) I documented everything I did as I went, so all the steps should be there:

                    1. Copied everything to C:\CTP2 after installation so as to not have any spaces in the path - just easier that way.

                    2. Opened up the ctp\civctp.dsw workspace.

                    3. Clicked "Yes to All" to convert all projects to new format.

                    4. Clicked "Build Solution".

                    5. Could not find "reftime.h"

                    6. Read the readme. And realised I didn't have DirectX Media SDK installed, only the DirectX SDK.

                    7. Downloaded and installed DirectX Media SDK.

                    8. Now, all projects except ctp2 built. The latter has 732 errors, and 1264 warnings.

                    9. A lot of the errors seem to come from the list-fixed header. So, introduced a new symbol for conditional compilation: USE_OLD_LIST_FIXED. Everything that included that one, now checks for the symbol. If the symbol is defined, list-fixed is used. Otherwise, the standard <list> is used. This change affected the following files: gs\gameobj\gaiacontroller.h; ai\diplomacy\Diplomat.h; ai\diplomacy\foreginer.cpp; ai\strategy\scheduler\Plan.h; ai\strategy\scheduler\scheduler.cpp; ai\strategy\scheduler\scheduler_types.h; ai\mapanalysis\settlemap.h. This helped some, as there were now 592 errors and 631 warnings.

                    10. But there still were problems with the standard library. It seemed the dbgallocator thingey might be responsible. So, I went to c3debugstl.h and used a new preprocessor symbol: USE_OLD_DBGALLOCATOR. If it is defined, then the dbgallocator class is used. Otherwise, it is just defined as std::allocator. This helped a lot, as there were now 150 errors and 732 warnings.

                    11. There was now the following last problem with the STL. The deque class used in the ai\strategy\scheduler\Scheduler class, attempts to find out the size of its template parameter using sizeof. However, we typedef a deque of Schedulers *inside* the scheduler class, hence at that point the class hasn't been defined yet (despite the forward delaration in the beginning of the header file), and hence sizeof fails with an error: "Use of undefined type 'Scheduler'". To work around that, I used yet another preprocessor symbol: USE_DEQUE_CONTAINER. If the symbol is defined, the deque is used as per the original code. Otherwise, a vector is used instead, as first proposed by Martin Guehmann. The problem count is now down to 118 errors, and 315 warnings. What's more, there are no more STL errors. Wohoo!

                    12. Next up, I wanted to fix up the sound, so I got the mss.h/mss.lib from Apolyton, and that worked. Thanks, jonwil. The problem count is now at 67 errors and 300 warnings.

                    13. Then, there was the deprecated std::_MAX macro. To take care of that, just replaced it with max whereever used. As well, the std::_MIN call was replaced with min. The affected files were: ui\aui_common\aui_control.cpp and ui\aui_ctp2\Original\radarmap.cpp. Note that min and max are windows-specific macros, however. It would be better to use std::min and std::max instead, but for those calls not to clash with the macros, one would need to #define NOMINMAX before #including <windows.h>. I was too lazy to search for that include, however, so I just used the macros. That got the problem count down to 45 errors and 17 warnings. (Note that I am not rebuilding the things that have already been built successfully, so the low warning count isn't really indicative of anything.)

                    14. Next, I decided to take care of a simple problem - the sizeof(enum) thing. I replaced that with enum CIV_INDEX, just 'cause it seemed that that's the enum that is being written, though I didn't read into the code much, so maybe just replacing this with sizeof(int) would have been a better workaround. Two more errors off.

                    15. Then there were the networking "reference to nonstatic member" problems. As per Ralph's solution, just replaced them all with NULLs for the time being. The files affected here were ui\netshell\ns_aiplayer.cpp, ui\netshell\ns_aiplayersetup.cpp, ui\netshell\ns_game.cpp, ui\netshell\ns_gamesetup.cpp, ui\netshell\ns_gplayer.cpp, ui\netshell\ns_lobby.cpp, ui\netshell\ns_player.cpp, ui\netshell\ns_playersetup.cpp, ui\netshell\ns_rplayer.cpp, ui\netshell\ns_server.cpp, ui\netshell\ns_session, and ui\netshell\ns_transport.cpp. Down to 8 errors, and 14 warnings.

                    16. Then, for some odd reason, there was a simple error. in gs\slic\SlicEngine.cpp, line 965 was like this:

                    symStart = 0;+

                    Note the plus on the end. Naturally, that caused an error. Fixed that.

                    16.5. I also had the problem of the compiler complaining about redefined InterlockedExchange in combase.h of the DirectX Media. Just commented that inline definiteion out, as mjs0 suggested.

                    17. Now, there was the following problem. In gs\slic\slicif.cpp, there are a few lines of code repeated in some functions, that read like this:

                    SlicDBInterface *conduit = (SlicDBConduit *)dbptr;

                    Now, SlicDBConduit is a templated class, hence the compiler was complaining that there are no template parameters. I replaced all five instances of this cast with:

                    SlicDBInterface *conduit = (SlicDBInterface *)dbptr;

                    That took care of that problem.

                    18. Next, a few more errors showed up. In ui\netshell\netfunc.cpp, the templated versions of the Handle function were not implemented according to the standard, and hence, whenever Insert(Add(new T(t))); was called, I got a "Unknown identifier 'T'" error. I had to replace that with the correct template parameter manually, like so:

                    bool NETFunc::ListHandler<NETFunc::Server>::Handle(Mess age *m) {
                    ...
                    Insert(Add(new T(t)));

                    went to

                    bool NETFunc::ListHandler<NETFunc::Server>::Handle(Mess age *m) {
                    ...
                    Insert(Add(new NETFunc::Server(t)));

                    And so on. After these changes, there were no more compilation errors.

                    19. Now, I got some linking errors about missing libraries for DirectX, and MirectX Media. Including those fixed the linking problem as well. The thing built!

                    20. But, it didn't run. Missing msvcrtd.dll, it said. Linking with anet2.lib instead of anet2d.lib fixed that problem, however. Thanks, mjs0. After this, everything seems to work, though I don't have the rest of the game, so I can't check. Gotta look for that CD some more.
                    Last edited by vovan; May 30, 2004, 23:20.
                    XBox Live: VovanSim
                    xbox.com (login required)
                    Halo 3 Service Record (I fail at FPS...)
                    Spore page

                    Comment


                    • #55
                      Good work vovan

                      I am sure that some people will try to verify it either in .NET or .NET 2003 with the full game installed

                      Comment


                      • #56
                        Thanks vovan,

                        but you didn't mentioned my current problem about the tech_wllist.h. This file still does trouble and I have no idea how to come around it, however I tried to compile the file alone on a Linux g++ compiler and I got at the same place in that file a message about a depriciated feature I reported about this in the Linux thread.

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

                        Comment


                        • #57
                          Martin,

                          I listed all the problems I encountered, I think. And I don't recall any problems with tech_wllist.h. However, I haven't really been following the threads around here lately, so could you please point me to the exact description of the problem? Maybe that would refresh my memory or give some ideas as to how to fix it.
                          XBox Live: VovanSim
                          xbox.com (login required)
                          Halo 3 Service Record (I fail at FPS...)
                          Spore page

                          Comment


                          • #58
                            Here is the post in question I made, I used a Linux g++ compiler to investigate the problem any further. However it reported a problem at the same position as the compiler of .NET, fortunatly closms has already answered the question. However obviously it was just a typename inserted at the right place.

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

                            Comment


                            • #59
                              That's odd. I definitely did not have that problem. Maybe it's a Visual Studio 7.0 vs 7.1 thing?
                              XBox Live: VovanSim
                              xbox.com (login required)
                              Halo 3 Service Record (I fail at FPS...)
                              Spore page

                              Comment


                              • #60
                                Originally posted by vovan
                                That's odd. I definitely did not have that problem. Maybe it's a Visual Studio 7.0 vs 7.1 thing?
                                Maybe, I don't know, but I suppose we have at university the newest stuff. However I am not able to check it, today. And well I hope it just work with this added word typename at the right place.

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

                                Comment

                                Working...
                                X