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

  • #46
    Alternatively, you could cut out the path prior to the command in the Custom Build settings, i.e. use just byacc, rather than $(CDKDIR)\byacc, and then add the place where byacc resides to your PATH.

    Comment


    • #47
      Well I now replaced all occurences of the path variable by the absolute path. But now it tells me that building of "C:\Activision\Ctp2\ctp2_code\GS\DBGEN\y.tab.c" failed when I try to compile the ctp2.exe. When I try to compile the ctpdb.exe it cannot open "/tmp/yacc.aa10481" and cannot find 'y.tab.h'.

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

      Comment


      • #48
        Creating a directory called c:\tmp for byacc to use for its temporary files should solve the latter problem, and you need to compile the ctbdb.exe before ctp2.exe, so hopefully once you've done that the first problem should go away.

        Comment


        • #49
          Well, in closing for today, here is my best error count to date (I think it's fairly deceptive though, there are other errors that are not being reached)
          Code:
          --------------------Configuration: ctp2 - Win32 Debug--------------------
          Compiling...
          vidplay.cpp
          c:\dx90sdk\include\control.h(165) : error C2146: syntax error : missing ';' before identifier 'OAEVENT'
          c:\dx90sdk\include\control.h(165) : fatal error C1004: unexpected end of file found
          Error executing cl.exe.
          
          CivCTP_dbg.exe - 2 error(s), 0 warning(s)
          I can get rid of these by switching to use the DirectMedia version of control.h, but then I get errors relating to the clock definitions because I need to use the DirectX version of strmif.h.

          I guess my next attack will be to try with DirectX 7.0a.

          Comment


          • #50
            I am down to 53 errors. Unfortunatly it starts with:

            Code:
            C:\Activision\Ctp2\ctp2_code\ctp\display.cpp(68) : error C2065: 'LPDIRECTDRAWENUMERATEEX' : nichtdeklarierter Bezeichner
            but the ideentifer should be declared in ddraw.h.

            And I get also two directX errors that causes a lot of other errors:
            Code:
            C:\DXMedia\classes\base\ctlutil.h(439) : error C2504: 'IBasicVideo2' : Basisklasse undefiniert
            C:\DXMedia\classes\base\sysclock.h(23) : error C2504: 'IAMClockAdjust' : Basisklasse undefiniert
            Well that should it be for tonight.

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

            Comment


            • #51
              OK I figured out how can I change in my Visuell C++ Authors Edition the project configuration. I switched to Debug and now I get:

              Code:
              --------------------Konfiguration: ctp2 - Win32 Debug--------------------
              Kompilierung läuft...
              display.cpp
              c:\activision\ctp2\ctp2_code\ctp\display.cpp(68) : error C2065: 'LPDIRECTDRAWENUMERATEEX' : nichtdeklarierter Bezeichner
              c:\activision\ctp2\ctp2_code\ctp\display.cpp(68) : error C2146: Syntaxfehler : Fehlendes ';' vor Bezeichner 'pfnEnum'
              c:\activision\ctp2\ctp2_code\ctp\display.cpp(68) : error C2065: 'pfnEnum' : nichtdeklarierter Bezeichner
              c:\activision\ctp2\ctp2_code\ctp\display.cpp(77) : error C2146: Syntaxfehler : Fehlendes ';' vor Bezeichner 'GetProcAddress'
              c:\activision\ctp2\ctp2_code\ctp\display.cpp(84) : error C2100: Zeigeroperation ungueltig
              Fehler beim Ausführen von cl.exe.
              
              CivCTP_dbg.exe - 5 Fehler, 0 Warnung(en)
              Looks like I just need a file were 'LPDIRECTDRAWENUMERATEEX' is properly defiened.

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

              Comment


              • #52
                Originally posted by Martin Gühmann
                Looks like I just need a file were 'LPDIRECTDRAWENUMERATEEX' is properly defiened.
                Or you can define it yourself as

                Code:
                typedef HRESULT (__stdcall *LPDIRECTDRAWENUMERATEEX) (int (__stdcall *) (GUID*,LPSTR,LPSTR,LPVOID,HMONITOR),LPVOID,DWORD);
                So much to do in so little time...

                Comment


                • #53
                  Alright, so I managed to compile and link it from the downloaded source, so I'm fairly sure it all made it out intact .

                  I am using XP and DevStudio 6. Without referencing my own README, here's what I had to do:

                  Set CDKDIR. If in Win98/ME, doing it in autoexec.bat is correct. The syntax there is SET CDKDIR=C:\cygwin\bin

                  Get DirectX and DXMedia. I am using DirectX 9, no problems.

                  MAKE SURE THE INCLUDE PATHS FOR DIRECTX AND DXMEDIA COME FIRST IN YOUR SETTINGS. That is very important, especially for DirectX. If you don't do this step, you will get the wrong version of ddraw.h, the one that's included with VC++ 6.0 is horribly outdated. Go to Tools->Options->Directories, Include Files, and put C:\DXSDK\Include at the top of the list, and just under it, add c:\DXMedia\include and then c:\DXMedia\classes\base. That assumes you installed them to DXSDK and DXMedia.

                  Copy the libraries into the ctp2 libs folder:

                  copy c:\dxsdk\lib\*.lib (ctp2_src)\libs\directx\lib
                  copy c:\dxmedia\lib\*.lib (ctp2_src)\libs\dxmedia\lib

                  (I actually just copied all of dxmedia there, but I think you only need the lib directory)

                  Remove the mss lib from the project settings. Project->Settings->Link, find ..\libs\miles\mss32.lib and remove it.

                  In CivSound.h, comment out #include "mss.h". Add this:

                  typedef void *HAUDIO;

                  In SoundManager.h, add this:

                  typedef void *HREDBOOK;

                  In civsound.cpp and soundmanager.cpp, remove the bodies of all the functions. (Leave return values in for non-void functions)

                  Make the temp directory for byacc (c:\tmp)

                  That is all I did today, and it all compiled, linked, and ran! Sound was missing of course, but it seems to work. I played one whole turn . But it's possible I did something else on this machine when I was putting things together for the release before.
                  Joe Rumsey - CTP Programmer

                  Comment


                  • #54
                    Thanks - the order of the include directories is what I most wanted to know...

                    Comment


                    • #55
                      I'm getting two errors when doing as Mr. Ogre suggested.
                      They are both concerning the video/movie section of the game.

                      Code:
                      K:\CTP2S\ctp2_code\ui\aui_directx\aui_directmovie.cpp(197) : error C2065: 'UNITS' : undeclared identifier
                      K:\CTP2S\ctp2_code\ui\aui_directx\aui_directmovie.cpp(197) : error C2065: 'MILLISECONDS' : undeclared identifier
                      Did you (Ogre) define those yourself (and if so, what values did you use) or how did you do away with them?
                      So much to do in so little time...

                      Comment


                      • #56
                        Well, I fix that problem (UNITS/MILLISECONDS) but
                        now I get a link error.

                        Code:
                        display.obj : error LNK2001: unresolved external symbol _xGetSystemMetrics@4
                        display.obj : error LNK2001: unresolved external symbol _xGetMonitorInfo@8
                        Any suggestions to why the linking fails?

                        GetSystemMetrics are defined "in" winuser.h which is included in windows.h
                        So much to do in so little time...

                        Comment


                        • #57
                          Originally posted by DDowell
                          Well, I fix that problem (UNITS/MILLISECONDS)
                          How? I did some late night compiling and have been working through errors. Although I haven't come across this one (yet), it would be useful to know how to jump the hurdles ahead. Thanks in advance.

                          Comment


                          • #58
                            I foolishly increased the warning level to 4, just as an experiment, and saw thousands of warnings (I later discovered that it was 51822...), so I decided that this was a bad idea and reduced it to level 3 again. Unfortunately, this has had no effect, and I'm still seeing level 4 warnings no matter what I do, even if I replace the project file with the original one from the source distribution... Does anyone have any ideas as to what might be going on? I can't carry on like this, and the only way I can see to solve this is to totally reinstall Visual Studio, or solve all 50000 odd warnings, and that would be tiresome...

                            Comment


                            • #59
                              Originally posted by ahenobarb


                              How? I did some late night compiling and have been working through errors. Although I haven't come across this one (yet), it would be useful to know how to jump the hurdles ahead. Thanks in advance.
                              I simply defined it as it stated in the MSDN. If it is entirely correct in as for the CTP2 source is concerned I'm not sure of.

                              This is the defines (and typedefs):
                              Code:
                              ...
                              #define NANOSECONDS 1000000000       //10^9
                              ...
                              #define MILLISECONDS 1000                   //10^3
                              ...
                              #define UNITS NANOSECONDS/100          //10^7
                              ...
                              Anyone got a suggestion to my link problem?
                              So much to do in so little time...

                              Comment


                              • #60
                                Originally posted by J Bytheway
                                I foolishly increased the warning level to 4, just as an experiment, and saw thousands of warnings (I later discovered that it was 51822...), so I decided that this was a bad idea and reduced it to level 3 again. Unfortunately, this has had no effect, and I'm still seeing level 4 warnings no matter what I do, even if I replace the project file with the original one from the source distribution...
                                I also fiddled around with the warnings a bit. But my target was to remove them altogether in order to get to the errors fasters

                                Have you checked the project settings carefully? Any /WX must be replaced/removed (exchange X for 0,1,2,3.. depending on warning level).

                                You say you cant get around it by replacing the .dsw? That's strange.
                                So much to do in so little time...

                                Comment

                                Working...
                                X