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

  • #16
    I have a new record - only 109 errors

    Edit: my mistake, I thought it was 110 before, not 101...

    Comment


    • #17
      Hopefully we can use #ifdefs to make a version which will compile under both conditions (not to mention gcc, too, but that will probably take rather longer)
      Check out the makefile and/or project workspace source. There are about 8 different versions you can create with Visual Studio alone: debug, test, final_test, release, etc...


      As for HAUDIO, I think uint should work for most undefined stuff... fortunately C++ is not too picky when it comes to type-checking...
      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

      Comment


      • #18
        Now I'm down to just 11 errors/12 warnings. Some are in display.h/.cpp, which are presumably due to non-backwards compatibility of DirectX 9.0b to 7.0a, and others have to do with the list include file (#include ), and I have no idea about those at all, but I guess it's related to what RalphTrickey was saying above.

        Anyway, here are the changes I have made to the CivSound class to get this far:

        In civsound.h replace the #include "mss.h" with:
        Code:
        // JJB MSS removal
        // #include "mss.h"
        
        // and redefine HAUDIO, HREDBOOK, which were
        // presumably defined in mss.h:
        
        #define HAUDIO uint32
        #define HREDBOOK uint32
        and in CivSound.cpp, replace the constructor with:
        Code:
        CivSound::CivSound(uint32 associatedObject, sint32 soundID)
        {
            const char *fname;
        	// JJB altered so that always fname == NULL
        	// and then m_hAudio never needs to be initialized
        	//if(soundID < 0)
        		fname = NULL;
        	//else
        	//	fname = g_theSoundDB->Get(soundID)->GetValue();
        
            
        	m_associatedObject = associatedObject;
        	m_soundID = soundID;
            m_isPlaying = FALSE;
            m_isLooping = FALSE;
            m_hAudio = NULL;
        
            
            if (fname == NULL) {
                m_soundFilename[0] = 0;
                m_dataptr = NULL;
                m_datasize = 0;
                return;
            }
        
        	// JJB cut out these lines which now never run
            //strcpy(m_soundFilename, fname);
        
            
            //m_dataptr = g_SoundPF->getData(m_soundFilename, &m_datasize);
        
            
            //m_hAudio = AIL_quick_load_mem(m_dataptr, m_datasize);
        }
        (The indentation is a little messed up due to my using tab length 4 in VC++)

        Comment


        • #19
          Here are some of those display errors:

          Code:
          Compiling...
          display.cpp
          c:\games\ctp2src\ctp2_code\ctp\display.h(11) : error C2146: syntax error : missing ';' before identifier 'hMon'
          c:\games\ctp2src\ctp2_code\ctp\display.h(11) : error C2501: 'HMONITOR' : missing storage-class or type specifiers
          c:\games\ctp2src\ctp2_code\ctp\display.h(11) : error C2501: 'hMon' : missing storage-class or type specifiers
          c:\games\ctp2src\ctp2_code\ctp\display.h(25) : error C2061: syntax error : identifier 'HMONITOR'
          c:\games\ctp2src\ctp2_code\ctp\display.cpp(55) : error C2039: 'hMon' : is not a member of 'DisplayDevice'
                  c:\games\ctp2src\ctp2_code\ctp\display.h(6) : see declaration of 'DisplayDevice'
          c:\games\ctp2src\ctp2_code\ctp\display.cpp(68) : error C2065: 'LPDIRECTDRAWENUMERATEEX' : undeclared identifier
          c:\games\ctp2src\ctp2_code\ctp\display.cpp(68) : error C2146: syntax error : missing ';' before identifier 'pfnEnum'
          c:\games\ctp2src\ctp2_code\ctp\display.cpp(68) : error C2065: 'pfnEnum' : undeclared identifier
          c:\games\ctp2src\ctp2_code\ctp\display.cpp(77) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
          c:\games\ctp2src\ctp2_code\ctp\display.cpp(84) : error C2100: illegal indirection
          c:\games\ctp2src\ctp2_code\ctp\display.cpp(268) : error C2039: 'hMon' : is not a member of 'DisplayDevice'
                  c:\games\ctp2src\ctp2_code\ctp\display.h(6) : see declaration of 'DisplayDevice'
          Which seems to mostly be due to an undeclared HMONITOR.

          And here are some of the list-related errors (well, technically they are warnings, not errors. In any case they are rather more difficult to decipher):
          Code:
          WldGen.cpp
          c:\program files\microsoft visual studio\vc98\include\list(178) : warning C4786: '?rbegin@?$list@PAVTransport@NETFunc@@V?$allocator@PAVTransport@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVTransport@NETFunc@
          @V?$allocator@PAVTransport@NETFunc@@@std@@@std@@PAVTransport@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(753) : see reference to class template instantiation 'NETFunc::List' being compiled
          c:\program files\microsoft visual studio\vc98\include\list(182) : warning C4786: '?rend@?$list@PAVTransport@NETFunc@@V?$allocator@PAVTransport@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVTransport@NETFunc@@V
          ?$allocator@PAVTransport@NETFunc@@@std@@@std@@PAVTransport@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(753) : see reference to class template instantiation 'NETFunc::List' being compiled
          c:\program files\microsoft visual studio\vc98\include\list(176) : warning C4786: '?rbegin@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$list@PAVPlayerStat@NETFunc@@V?
          $allocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVPlayerStat@NETFunc@@AAPAV45@PAPAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
          c:\program files\microsoft visual studio\vc98\include\list(178) : warning C4786: '?rbegin@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVPlayerStat@NETFu
          nc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVPlayerStat@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
          c:\program files\microsoft visual studio\vc98\include\list(180) : warning C4786: '?rend@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$list@PAVPlayerStat@NETFunc@@V?$a
          llocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVPlayerStat@NETFunc@@AAPAV45@PAPAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
          c:\program files\microsoft visual studio\vc98\include\list(182) : warning C4786: '?rend@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVPlayerStat@NETFunc
          @@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVPlayerStat@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
                  c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
          Last edited by J Bytheway; October 29, 2003, 11:17.

          Comment


          • #20
            Originally posted by J Bytheway
            In civsound.h replace the #include "mss.h" with:
            Code:
            // JJB MSS removal
            // #include "mss.h"
            
            // and redefine HAUDIO, HREDBOOK, which were
            // presumably defined in mss.h:
            
            #define HAUDIO uint32
            #define HREDBOOK uint32
            On second thoughts, I probably should have used typedefs rather than #defines there, but it works anyway...

            Comment


            • #21
              VS6 to VS.NET conversion

              Originally posted by J Bytheway


              What do you mean by the latter - there aren't any "s in the Flex and Bison build commands, are there? They look something like:

              Code:
              $(CDKDIR)\flex -i -o$(ProjDir)\lex.yy.c $(InputPath)
              I hope it is OK for a relative newbie to the CTP forums to jump in here (OK, I admit it I've been lurking since before CTPI was released)...I have a lot of hard earned experience in tracking down Visual C++ build errors and couldn't resist pulling down the code to experiment for myself.

              Whilst the original VS6 civctp.dsp file (i.e. the project file) does not have quotes in the custom build definitions that invoke flex, byacc etc. all dsw/dsp files go through a conversion process when loading them in VS.NET for the first time resulting in sln/vcproj files that are now stored in XML.

              The conversion process is (how shall I put it) ...suboptimal when dealing with environment variables in custom build commands. Basically the conversion process inserts &ampquot before and after each environment variable resulting in the crippled workspace and project files we now see.

              Probably the quickest way to fix this would be to edit the XML files as text and do a global search/replace on a pattern of &ampquot($envvar)&ampquot with ($envvar) for each affected environment variable.

              I guess I'll try my own suggestion and let you all know if it works.

              Martin
              Last edited by mjs0; October 29, 2003, 11:37.
              I think therefore I CIV

              Comment


              • #22
                The most promising lead I have on HMONITOR is what looks like it might be a definition on line 267 of windef.h, which is amongst the VC++ library files:
                Code:
                #if(WINVER >= 0x0500)
                #ifndef _MAC
                DECLARE_HANDLE(HMONITOR);
                DECLARE_HANDLE(HTERMINAL);
                DECLARE_HANDLE(HWINEVENTHOOK);
                #endif
                #endif /* WINVER >= 0x0500 */
                All this kind of stuff is starting to go over my head, though .

                Comment


                • #23
                  Re: VS6 to VS.NET conversion

                  Originally posted by mjs0
                  Whilst the original VS6 civctp.dsp file (i.e. the project file) does not have quotes in the custom build definitions that invoke flex, byacc etc. all dsw/dsp files go through a conversion process when loading them in VS.NET for the first time resulting in sln/vcproj files that are now stored in XML.
                  That makes sense, but it doesn't get me any closer to knowing why the building was not working properly under VS6... But I guess it's not really important (at least until we start fiddling with the lexer/parser files).

                  Comment


                  • #24
                    Re: VS6 to VS.NET conversion

                    Originally posted by mjs0

                    Probably the quickest way to fix this would be to edit the XML files as text and do a global search/replace on a pattern of &ampquot($envvar)&ampquot with ($envvar) for each affected environment variable.

                    I guess I'll try my own suggestion and let you all know if it works.

                    Martin
                    Well...for VS.NET this approach fixed all the custom build errors so the calls to flex, byacc, ctpdb et al ran successfully.

                    Now I just have the compiler problems (3275 errors and 1486 warnings) to resolve!!

                    Martin.
                    I think therefore I CIV

                    Comment


                    • #25
                      Well, I popped in a copy of DECLARE_HANDLE(HMONITOR) (which is almost certainly a really bad idea, but never mind) and now the first errors I get are in the DXMedia files, which is a bad sign...
                      Code:
                      vidplay.cpp
                      c:\dxmedia\classes\base\ctlutil.h(439) : error C2504: 'IBasicVideo2' : base class undefined
                      c:\dxmedia\classes\base\sysclock.h(23) : error C2504: 'IAMClockAdjust' : base class undefined
                      I also have a whole host more errors in SoundManager.cpp - mostly undeclared identifiers...

                      Comment


                      • #26
                        Originally posted by DDowell
                        How do I solve this?

                        --------------------Configuration: ctp2 - Win32 Debug Browse--------------------
                        Performing Custom Build Step on ..\ui\ldl\ldl.y
                        k:\Activision\CTP2Source\bin\byacc: f - cannot open "/tmp/yacc.aa01116"
                        Error executing c:\windows\system32\cmd.exe.

                        CivCTP_dbg.exe - 1 error(s), 0 warning(s)
                        Just create a temp directory that byacc can write to on your C: hard drive.
                        XBox Live: VovanSim
                        xbox.com (login required)
                        Halo 3 Service Record (I fail at FPS...)
                        Spore page

                        Comment


                        • #27
                          Originally posted by J Bytheway
                          Well, I popped in a copy of DECLARE_HANDLE(HMONITOR) (which is almost certainly a really bad idea, but never mind) and now the first errors I get are in the DXMedia files, which is a bad sign...
                          Code:
                          vidplay.cpp
                          c:\dxmedia\classes\base\ctlutil.h(439) : error C2504: 'IBasicVideo2' : base class undefined
                          c:\dxmedia\classes\base\sysclock.h(23) : error C2504: 'IAMClockAdjust' : base class undefined
                          I also have a whole host more errors in SoundManager.cpp - mostly undeclared identifiers...
                          Well, maybe I'm just pointing out the obvious, but... HMONITOR is just a windows handle for monitors, which can be used to enumerate all of the monitors connected to the system. It's just a GDI thing, so the definition should be included in windows.h, if I am not mistaken...
                          XBox Live: VovanSim
                          xbox.com (login required)
                          Halo 3 Service Record (I fail at FPS...)
                          Spore page

                          Comment


                          • #28
                            Very interesting. I went ahead to build the source, and got 111 errors. Then I changed the sound system files as John suggested, and got 118 errors on next build.
                            Solver, WePlayCiv Co-Administrator
                            Contact: solver-at-weplayciv-dot-com
                            I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                            Comment


                            • #29
                              Originally posted by J Bytheway
                              Does anyone know what the difference is between a "Debug" build and a "Debug Browse" build - I was doing the former but I see that DDowell was doing the latter...
                              LOL, whoops, forgot about that. You'll want to not use the browse version. I was the one who added the browse version, and it was because I was the only programmer who used both browse info & remote debugging. So (if I remember correctly) it has all kinds of settings that were specific to my machine. The code it generated was the same as debug, it just had additional stuff for me in it, like the inclusion of Browse info, and the remote debugging stuff, but it also has some post build steps that were unique to my machines.

                              Pyaray

                              Comment


                              • #30
                                John: (RE: HMONITOR)

                                Found this after doing a goodle on the error msg:

                                ----- Original Message -----
                                From: Jacek Ringwelski
                                To: cdx@yahoogroups.com
                                Sent: Friday, November 09, 2001 5:57 AM
                                Subject: Re: [cdx] Compilation Error in CDX 3.1


                                If your compiling the libraries you need to do the following.

                                Copy all header file (*.h) from the include directory and paste a copy of
                                them in the source directory then compile....the workspace was saved and
                                then the includes were moved to a different directory, that's why you can't
                                compile as it is currently....

                                Dev/Admin,
                                Jacek Ringwelski

                                Comment

                                Working...
                                X