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

  • #31
    Originally posted by Solver
    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.
    Were they semantic or syntactic? I've managed to get past the syntax errors now, so I get a whole lot more semantic ones (Undeclared identifiers, etc.). Whereabouts are the errors occuring?

    In any case the exact number of errors seems to be subject to significant random fluctuation...
    Last edited by J Bytheway; October 29, 2003, 19:12.

    Comment


    • #32
      Originally posted by vovansim
      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...
      Well, as I said, I found it in windef.h (which is included by windows.h, which is included by c3.h) but for some reason it's obviously not being processed properly. I don't quite understand the message in Dale's post - does it mean to copy the header files from the VC98\include directory to somewhere in the ctp2_code directory structure? If so, where?

      Comment


      • #33
        OK, I think I've found the problem with HMONITOR - because this is an old version in some sense it's supposed to be using the definition in multimon.h rather than windef.h. I stuck a #include <multimon.h> in the display.h (It was already included in display.cpp so that shouldn't be too drastic a step) and that seems to fix the problem.

        I've also commented out most of the code in the SoundManager class, and set it up so that the constructor always reports failure which should then disable the sound system altogether (That's what the code suggests will happen... I just hope that all the code which uses the sound manager bothers to check that it's there first...).

        I think that now my only problems are due to those undeclared base classes in the DirectX Media stuff (It causes lots of knock-on errors in vidplay.cpp).

        Comment


        • #34
          John, I got no idea what the stuff in my above post meant. I was just saying I found it in a google on the error.

          Comment


          • #35
            Is it possible to run some kind of "inclusion trace" on the compiler - I want to know how it came to be compiling ctlutil.h, where the error is, starting from vidplay.cpp.

            It seems to be through streams.h, but that includes control.h, where the base class is defined, before ctlutil.h, where it was found not to be defined.

            Hmm... Why can't we port the whole thing to C#, and then we won't have to worry about these stupid #include statements or the order of declaration at all. They always make my head spin...

            And since my head is spinning I think I'll go to bed, but I should probably document my changes to SoundManager.cpp, so I've attached a copy of the version I'm using - in addition to this I added a declaration of S32 to CivSound.h like the other two #defines.

            (I added a .txt extension in order to be able to upload this without zipping it - so Locutus, could you possibly get .cpp and .h (and maybe .l and .y) approved as extensions - I suspect we may need them a lot)
            Attached Files

            Comment


            • #36
              Well, here are some references on the primary errors I am now getting - I cannot totally decipher any of them, I think because they refer to DX 8. They also mention "Platform SDK". Does anyone know what that is?

              From http://www-personal.monash.edu.au/~d...h/DShowOpenCV/

              I get the following errors when compiling a directshow filter! Whats going on?

              ...
              \MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\wxut il.h(530) : error C2061: syntax error : identifier 'DWORD_PTR'
              \MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\ctlu til.h(437) : error C2504: 'IBasicVideo2' : base class undefined
              \MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\ctlu til.h(904) : error C2146: syntax error : missing ';' before identifier 'm_dwAdvise'
              \MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\ctlu til.h(904) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
              \MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\ctlu til.h(904) : error C2501: 'm_dwAdvise' : missing storage-class or type specifiers
              \MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\amfi lter.h(286) : error C2061: syntax error : identifier 'LONG_PTR'
              \MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\amfi lter.h(953) : error C2504: 'IPinFlowControl' : base class undefined
              ...

              ANS: -Aug2002- The include path for your directX SDK or Platform SDK must place first under tools/options/Directories/include


              This answer I simply cannot comprehend - it doesn't seem to be gramatically correct...

              From http://www.funkaspuck.com/mailz/opendivx/msg00206.html

              That was the problem with DirectShow before version 8.
              I fixed it by just erasing usage of these interfaces in the
              header files. The 8 version works fine without any adjustment.


              Which essentially says that the video code needs to be rewritten - I may well try to outcomment it in the mean time since there aren't really many videos in CTP2.

              From http://www.unibrain.com/support/deve...evelopment.htm

              2. I installed Fire-i™ and everything went fine all executables and the drivers are working. When I tried to compile the sample programs using VC++ I get: i) compiler errors like these: …error C2504: 'IBasicVideo2' : base class undefined …error C2146: syntax error : missing ';' before identifier 'm_dwAdvise' …error C2501: 'DWORD_PTR' : missing storage-class or type specifiers or, ii) linker errors like these: CameraInfo.obj : error LNK2001: unresolved external Symbol _IID_IAMVideoControl Controler.obj : error LNK2001: unresolved external Symbol _IID_IAMVideoControl CameraInfo.obj : error LNK2001: unresolved external Symbol_IID_ICaptureGraphBuilder2 Whats wrong ???

              First of all you must install Platform SDK and DirectX8.0 SDK under the same directory, the default option is "c:\mssdk" from now this path will be reffered as (SDK root). Secondly you must build strmbasd.lib(debug version), or strmbase.lib(release version), "To use the base classes in MicrosoftR DirectShowR, you must build and link the base class library, located in the following directory: (SDK root)\Samples\Multimedia\DirectShow\BaseClasses Note Previous versions of the SDK included the libary as a binary file. With MicrosoftR DirectXR 8.0, you must build this library yourself if you plan to use the base classes."The above quotation is extracted from MS DirectX 8.0 help in: " DirectX 8.0(C++)\DirectShow\DirectShow Reference\DirectShow Base Classes\Using..." You can check it for more information on building the lib. After building that lib you must make sure to point the compiler to search for the header files in: "(SDK root)\Samples\Multimedia\DirectShow\BaseClasses" first, and "(SDK root)\include" second. To do that under VC++6 modify the project's preprocessor settings in "Additional Include directories" textbox in "Project®Settings®C++ Tab" or modify the VC++ global settings by setting the "Include files" in "Tools®Options®Directories Tab" so that the above mentioned paths to the header files are listed in the order mentioned. Also point the linker to search in: "(SDK root)\Samples\Multimedia\DirectShow\BaseClasses\De bug" first, and "(SDK root)\lib" second. Again one way to do that is by adding the "(SDK root)\Samples\Multimedia\DirectShow\BaseClasses\De bug" path in the"Library Files" directories of the "Tools®Options" dialog box under "Directories" tab on top of the list and "(SDK root)\lib" second. Also add strmbasd.lib in "Object/Libraries" textbox in "Project®Settings®Link Tab". You must make sure that the files in the above mentioned directories are the files used by the compiler since there are probably more than one versions of these libraries (like strmbasd.lib) and header files(like streams.h) scattered around in your system.


              This seems the most promising answer, but none of the directories mentioned in it exist in my installation of the SDK - perhaps that's because of the lack of the mysterious "Platform SDK".

              Alternatively, I could just interperet this as saying that the wrong file is probably being included - something I will look into. In particular one relevant file is called control.h, and there could easily be many files of that name...

              Anyway, I won't be doing any of this immediately, but I thought I'd check in. This seems to be turning into another one of those threads where I make more than half the posts, but I guess that doesn't hurt my post count . (Edit: If my count is correct my posts account for exactly half... )

              Comment


              • #37
                you have done 18 the rest has done 18 (not including this one)

                which means with my post your wrong ha ha ha ha
                "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                The BIG MC making ctp2 a much unsafer place.
                Visit the big mc’s website

                Comment


                • #38
                  Let me help John a little further

                  CtP2 was designed with DirectX 7, so maybe the DirectX problems can be solved by installing the DirectX 7 SDK instead of the DX9 version? I checked the MS website and they still have it available for download. I'm at work now and won't have time tonight, so can't try myself. But if someone has time, might be worth a shot...

                  DirectX 7.0a SDK: http://www.microsoft.com/downloads/d...displaylang=en

                  (if the link doesn't work: http://msdn.microsoft.com/downloads/ > enter 'directx sdk' as keyword and click on Go (don't press Enter, won't work!); the file should be on page 2)
                  Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                  Comment


                  • #39
                    I did what Locutus suggested and installed DirectX 7.0a and DirectX Media SDK as suggested in the readme. I was able to compile the map plug ins Crater.dll, fault.dll, geometric.dll and Plasma2.dll without any problems. I wasn't able to compile the other two projects, because I don't know where I should set the CDKDIR invironment variable. It is very nice that Mr Ogre described the setup process for Windows XP/2000, but I still use Win98. So what is the equivalent of Panel->System->Environment Variables. So what is ment by Panel, does he mean the start menue?

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

                    Comment


                    • #40
                      It is the control panel (usually accessable through the start menu yes).

                      But if you can set env. variables through it on the 98 I'm not sure of...
                      So much to do in so little time...

                      Comment


                      • #41
                        You should be able to set environment variables at the command promt too, syntax is something like:
                        Code:
                        SET CDKDIR=C:\...
                        I suggest you search the windows help for "environment variable" (Or some German translations thereof...)
                        Last edited by J Bytheway; October 30, 2003, 16:23.

                        Comment


                        • #42
                          I *think* you need to set them up in Autoexec.bat...
                          Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                          Comment


                          • #43
                            Unfortunatly I already had the idea to put:

                            SET CDKDIR = C:\Activision\CTP2\bin

                            into my Autoexec.bat

                            I didn't find anything about "environment variable" or "Umgebungsvariable" in the windows help.

                            Does anybody know how the dos command is called that could me show all defined varaibles in.

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

                            Comment


                            • #44
                              Yes, just type SET to list all defined variables, or SET CDKDIR to print the current value of CDKDIR.

                              If all else fails you can just substitute the value you want for all occurances of CDKDIR in the Custom Build settings - there aren't really that many of them.

                              I am making further progress - I have tried shifting around the order of the include directories in order to get the right files included (because many share the same names). Unfortunately, whichever order I use I get at least some errors, but different ones in each case. I'm not sure how to handle this yet...

                              Comment


                              • #45
                                SET CDKDIR prints Syntaxfehler in English syntax error. Set alone prints all the variables and CDKDIR with its supposed value is there. Fortunatly I only have to change some project file and not the source itsself.

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

                                Comment

                                Working...
                                X