Announcement

Collapse
No announcement yet.

COMPILE: Getting the source to compile on VS.NET

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

  • #16
    Everything compiles and links, now for the unable to load dll errors...

    Comment


    • #17
      Originally posted by RalphTrickey
      Everything compiles and links, now for the unable to load dll errors...
      Believe it or not I have just this second finished my first move in debug mode!

      I also had some issues with dll load failures.
      My problem was caused by anetd.dll which was built with an older version of VC++ and linked in msvcrtd.dll which does not exist for VS.Net.
      I got around the problem by linking the debug build with anet.lib instead of anetd.lib.

      After that everything ran beautifully until I quit at which point I got a debug assertion raised in resource.cpp line 171.

      Martin.
      I think therefore I CIV

      Comment


      • #18
        Just looking back over my notes of things I had to change to get to this point.

        One of the things that really stands out is how little trouble there was with DXMedia/DirectX, especially compared to the VS6 thread on this forum.

        For DirectX I used the latest DX9 SDK and all I had to do for DXMedia was make a couple of simple changes to combase.h and refclock.h

        If I read my notes right I had to
        1. comment out an inline definition for InterlockedExchange in combase.h (as .net supports volatiles passed directly to this API)

        2. Change #include to #include "schedule.h" as the former was pulling in the runtime version of schedule.h instead of the DXMedia version. This was causing multiple failures due to the resulting absence of CAMSchedule.

        (I know there are more elegant fixes to both of these issues!)

        Did others see only these DXMedia issues?

        For the mss.h issue I simply created stubs for each of the missing functions (and put them in civsound.h) plus ensured they returned an error when appropriate.

        I'll try to get my notes in decent shape and post a detailed list of the steps I went through later this evening. (The list will have significant overlap with what is already on here but hopefully will still prove valuable.)

        Martin.
        I think therefore I CIV

        Comment


        • #19
          Thanks for the hint about anet.

          I didn't have any issues related to DirectX or DirectMedia. I did have to add several header files that weren't included, they were probably moved around.

          I do have a problem where running at startup fails when It tries to call a routine to get the cpu frequency in c3cpu. This causes problems for me with the mouse move function not working.

          When I commented that out, I was able to run and I get the same failure that you do with the assertion.

          It was surprisingly painless, although for me, sound and the networking stuff is commented out.

          I was able to save and load a game.

          Ralph

          Comment


          • #20
            I'm sorry, but can some of you guys who understand this whole thing better, please help me out. First of all, I use VC 2003, i.e. v 7.1 (but I suppose it should not bee too different from 2002 - 7). Ihave a few questions:
            1. I installed DX 9 SDK. But I don't have DX Media 9 SDK, and cannot download it - it's just way too big. Can anyone tell me what is the solution? Does anyone have the actual files it refers to - i.e. reftime.h?
            2. What should be done to the sound system, to get around miles library? The were several work arounds, but which one is better?
            3. I seem to have a lot of problems with PointerList.h - has anyone manged to get through it?
            4. Perhaps someone can post a working .ent compiled version once he manages to do it. This will make may things easier for others.
            Thanks a lot.

            Comment


            • #21
              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"). That way you dont need to create a directory at c: level (if you dont like that for some reason).
              TMPDIR is the env variable that byacc will look for and will default to /tmp if not found.

              Anybody already got a compilable version (except mss.h errors which are obvious) of the source under .net?

              ata

              Comment


              • #22
                hmmm I still try to compile it under .NET though still having difficulties

                I commented the #include lines out and tried it with the .NET version of with moderate success:
                #ifdef VSNET
                #include
                #else
                #include
                #endif

                Then I had the problem that in template class list there are 2 typedefs that use _Node and _Genptr from _List_nod but they are protected and list constantly complains that it cannot access these protected member values.
                So I changed in that I replaced protected in _List_nod with public.
                Seems to work. Its strange though because _Node is declared friend and as far as I am informed is therefor accessible outside the current scope.
                However I dont think it is great to mess around with the STL includes, so this may not be the best fix.

                I also changed the Scheduler thing as advised here and then recompiled.

                79 Errors left (and 1050 warnings )

                though some of the errors are related to the _MAX macro things for which there is a solution here but I havent addressed it yet.

                Then there are still a lot illegal references to non-static members all in ui\netshell\ns_*.cpp ( I have no idea what they are all about or how to fix them [except maybe writing static in front ])

                the others are still errors in and

                Overall I think I have to get a lot more experience with c++ and STL
                The C++ programming language book by Bjarne Stroustrup is lying next to me (but hasnt been of much help). Nevertheless I think I should read it.

                Anyone else made any progress?

                Comment


                • #23
                  Atahualpa,
                  Look up in this thread, and you'll see a work-around to the NS_ issue.

                  I changed the stl headter ot and that seemed to fix many issues with the list class.

                  I've actually gotten it to run, but then I modified something in the CTP2 options, and haven't been able to get it to run since.

                  Anyone know where the options are stored?

                  Ralph

                  Comment


                  • #24
                    In userprofile.txt (in the same folder as the executable).
                    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                    Comment


                    • #25
                      Ralph: oops I should have checked the thread more intense. I also ran into the sizeof(enum) thing. I thought WTF???

                      Can somebody with VC6 compile this little program:
                      Code:
                      #include <iostream.h>
                      #include <conio.h>
                      
                      int main(int argc, char** argv)
                      {
                          int test;
                          test = sizeof(enum);
                          cout<<"sizeof(enum): "<<test;
                          getch();
                          return 0;
                      }
                      I hope that compiles, I always mix c and c++ ^^

                      I dont know when I can give it another shot at compiling because I dont have much time.

                      Btw: the list thing? Is this a bug in the MS STL?

                      ata

                      edit: in between [ code ] this forum could really replace < with &lt; and > with &gt;
                      Last edited by Atahualpa; November 7, 2003, 05:48.

                      Comment


                      • #26
                        Ah yes I have found an interesting mail:



                        [..]The size of an enumeration *type* is implementation-defined, while the size of an enumeration *constant* is the size of an int.[..]
                        I guess its okay to write sizeof(int) then

                        Comment


                        • #27
                          VC6 has sizeof(enum): 4

                          Comment


                          • #28
                            Originally posted by Locutus
                            In userprofile.txt (in the same folder as the executable).
                            Thanks. I deleted it, and everything works again.

                            Comment


                            • #29
                              Anyone found a solution to the netshell thing already? (not a compiler-work-around)

                              I really like to know how on earth that can compile on VC6!?!?!! illegal reference to non static member is not something VS.NET specific.

                              The problem is that list is declared static in ns_accessor.h and yet you want to add non static members of ns_AIPlayer for example. This can never work out!!! I dont get it. How should the executable know which object's member variable to add to the list.

                              Besides can someone explain what this should do? There must be another solution to this.

                              ata

                              Comment


                              • #30
                                Originally posted by Atahualpa
                                Anyone found a solution to the netshell thing already? (not a compiler-work-around)

                                I really like to know how on earth that can compile on VC6!?!?!! illegal reference to non static member is not something VS.NET specific.

                                The problem is that list is declared static in ns_accessor.h and yet you want to add non static members of ns_AIPlayer for example. This can never work out!!! I dont get it. How should the executable know which object's member variable to add to the list.

                                Besides can someone explain what this should do? There must be another solution to this.

                                ata
                                This code is clearly illegal. I'll bet that on VC6, the code does something like... ns_array[0].data = &ns_array[0].text, that is it implicitly access the n'th array on the right hand side during the assignment. The solution is to break it into two parts, the main part is similar to what I posted above. The second part is in the initialization section, to actually make the assignments. I played with this a little, but coudn't get the cast right.

                                Ralph

                                Comment

                                Working...
                                X