Announcement

Collapse
No announcement yet.

COMPILE: Getting the source to compile on VS.NET

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

  • COMPILE: Getting the source to compile on VS.NET

    Okay, the Getting the source to compile thread is great, but it is starting to overflow with different kinds of information. I think it would be good to keep different discussions separate, and since that other thread has pretty much gotten to the point of taking care of CivSound, I thought a new thread for us VS.NET users is in order. So, the progress I have achieved so far is this:

    The conversion from VS6.0 files to .NET was successful, and I had no problems with the quotes as people in the other thread have said. The problems I did have were as follows:
    • Custom Build Step couldn't find byacc and bison.
      Solution: Put the binaries into some path that does not contain spaces in it.
    • byacc couldn't find the source file.
      Solution: Put the source files into some path that doesn't contain spaces in it.
    • byacc: f - cannot open "/tmp/yacc.aa####"
      Solution: Create a C:\tmp directory (or replace the C: drive with whichever one you have your byacc on).
      Alternative Solution: Create an environment variable "TMPDIR" that points to a temp directory (e.g.: "%systemroot%\TEMP").
      (Atahualpa)
    • The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.
      Solution: Some template defintions now require the additon of the typename keyword to compile.
      (RalphTrickey)
    • Some of the math functions (sqrt, ceil, floor) now require floats instead of integers.
      Solution: Cast them to double. I think that I remember one that had ceiling of a number divided by 2. This will always return the floor instead. These should be fixed and documeted for anyone working on v6.
      (RalphTrickey)
    • The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.
      Solution: For now, do a global search and replace of dbgallocator< with std::allocator<
      (RalphTrickey)
    • Ambiguous overload.
      Solution: The line
      aui_TextBase((MBCHAR *)NULL, (uint32)0)

      needs to be

      aui_TextBase((const MBCHAR *)NULL, (uint32)0)
      (RalphTrickey)
    • std::_MAX has changed.
      Solution: Replace with max
      (RalphTrickey)


    -----------------

    I was thinking that this would be a good start for sort of an FAQ, or step-by-step instructions, on how to get the thing to compile on .NET. So, if anyone has made more progress than I have, please post here, and I will update the list above.
    Last edited by vovan; November 2, 2003, 22:19.
    XBox Live: VovanSim
    xbox.com (login required)
    Halo 3 Service Record (I fail at FPS...)
    Spore page

  • #2
    Okay, there is definitely something screwed up with the different versions of the STL. The fixed-list header references certain members of classes with too few template parameters, and then if I use the regular list, then there are some other errors like that, too. So, my idea at first was to download the latest version of the STL, and see if that helps any. Now that I've seen how many more errors it's produced, I realize that is rather stupid, taking into consideration the age of the game.

    So, the next great idea is this: could one of you kind folks that uses VS 6.0 zip up the includes folder and post it here / PM it to me? I'm thinking the older version of the STL might do the trick. Either that or feel free to post why such an idea is completely wrong and any better ideas if any.
    XBox Live: VovanSim
    xbox.com (login required)
    Halo 3 Service Record (I fail at FPS...)
    Spore page

    Comment


    • #3
      Oh, this thread is ringing a rusty and cobwebbed bell in the back of my cranium.

      There is an "unofficial" STL fix for the MS STL. I don't remember where it came from, but I think that we used a non Microsoft version of STL.

      I'm sorry, I know this isn't much help, given that I don't recall where we got it. But I don't think there are any differences between the .net & the vs6 STL.

      Pyaray

      Comment


      • #4
        Re: Getting the source to compile on VS.NET

        Originally posted by vovansim
        4. Now I am having plenty of errors in regards to the STL and the use of incomplete definitions (like, typedefing a deque template with the class parameter from within that class. While that is allowed for compilation, it isn't handled correctly by .NET for some reason.)
        Solution: None that I can see right now.
        The problem here is that it is DEFINING an instance of the type (s_Scheduler(?) inside the class. The definition now requires the size of the item.

        Solutions...

        Short term.. Move s_Scheduler out of the class and into a static variable in the.cpp file.

        Comment


        • #5
          Problem...
          The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.

          Solution...???

          Ralph

          Comment


          • #6
            Solution...
            some template defintions now require the additon of the typename keyword to compile.

            Comment


            • #7
              Problem...
              some of the math functions (sqrt, ceil, floor) now require floats instead of integers.

              Cast them to double. I think that I remember one that had ceiling of a number divided by 2. This will always return the floor instead. These should be fixed and documeted for anyone working on v6.

              Comment


              • #8
                Originally posted by RalphTrickey
                Problem...
                The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.

                Solution...???

                Ralph
                For now, do a global search and replace of dbgallocator< with std::allocator<

                Comment


                • #9
                  Problem...
                  the NS_ files (for example ns_games) don't compile as is. I'm not sure what they are supposed to do, or what they do in V6.

                  Comment


                  • #10
                    Problem...
                    Ambiguous overload.
                    Solution...
                    The line
                    aui_TextBase((MBCHAR *)NULL, (uint32)0)

                    needs to be

                    aui_TextBase((const MBCHAR *)NULL, (uint32)0)

                    Comment


                    • #11
                      problem...
                      std::_MAX has changed.
                      solution
                      replace wiht max

                      Comment


                      • #12
                        Thanks, Ralph! That fixed a bunch of errors. I'm thinking now it would be nice to actually implement the changes we make this way in such a way that it doesn't screw things up if we share the code between the people on VS 6 and VS.NET. Probably a good idea to have some #ifdefs in there.

                        And also, Pyaray, thanks for your response. The list-fixed file contains this comment:

                        // REM102200: fixed as per http://www.dinkumware.com/vc_fixes.html

                        So, I suppose that's where the fix was gotten from. Or was list not the only fix you used?
                        XBox Live: VovanSim
                        xbox.com (login required)
                        Halo 3 Service Record (I fail at FPS...)
                        Spore page

                        Comment


                        • #13
                          I'm afraid I don't remember, and I'm not sure I ever actually had that knowlege. The build environment was already set up for me when I got there. Remember that I joined the team really late in development.

                          Pyaray

                          Comment


                          • #14
                            Problem...
                            The ns_files won't compile.
                            Work-Around...
                            Code like the follwing...
                            ns_AIPlayer::Struct ns_AIPlayer::list[] = {
                            {STRING, 0},//(Data)&m_name},
                            {STRING, 0},//(Data)&m_tribe},
                            {INT, 0},//(Data)&m_civpoints},
                            {INT, 0},//(Data)&m_pwpoints}
                            };
                            Solution...
                            ???

                            Comment


                            • #15
                              Problem...
                              sizeof(enum) is undefined
                              Work-around... For now, use sizeof(int)
                              solution...
                              ??? Possibly see what it's used for/see what value vc6 has.

                              Comment

                              Working...
                              X