Announcement

Collapse
No announcement yet.

Help: Compiling CTP2 against DXSDK 9.0 only

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

  • Help: Compiling CTP2 against DXSDK 9.0 only

    I figured out by accident (hardlocks on new win98 setup ), that some of us using DX90SDK might link DirectShow against the DXMedia libs, which were designed for DX7.0 and have been consolidated into DX SDK from about 8.x on.
    I guess compiling against the libs of the same SDK might give some stability improvements, so i started that way:
    • open civctp.dsw
    • remove DXMedia includes from path settings
    • add C:\DXSDK\Samples\C++\DirectShow\BaseClasses as a top include path (below DXSDK\include)
    • open C:\DXSDK\Samples\C++\DirectShow\BaseClasses\basecl asses.dsw
    • compile at least the release and debug version
    • delete/move libs\DXMedia out of the ctp2 source path
    • add C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Releas e and C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Debug to the libraries search path
    • open civctp.dsw again
    • remove ..\libs\dxmedia\lib\ prefix for each dxmedia .lib in linker section of ctp2.


    Now, i'm stuck at this (everything compiles, but CivCTP_dbg.exe/CivCTP.exe does not link):
    Code:
    Linker-Vorgang läuft...
    LINK : warning LNK4075: /INCREMENTAL wird auf Grund der Angabe von /DEBUGTYPE ignoriert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IKsPropertySet bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IReferenceClock bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawColorControl bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawClipper bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawPalette bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawSurface7 bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawSurface4 bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawSurface3 bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawSurface2 bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDrawSurface bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDraw2 bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _IID_IDirectDraw bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _CLSID_DirectDrawClipper bereits in WldGen.obj definiert
    strmbasd.lib(strmiids.obj) : error LNK2005: _CLSID_DirectDraw bereits in WldGen.obj definiert
    strmbasd.lib(wxutil.obj) : error LNK2001: Nichtaufgeloestes externes Symbol __imp__SysAllocString@4
    strmbasd.lib(wxutil.obj) : error LNK2001: Nichtaufgeloestes externes Symbol __imp__SysFreeString@4
    CivCTP_dbg.exe : fatal error LNK1120: 2 unaufgeloeste externe Verweise
    Fehler beim Ausführen von link.exe.
    So some COM-Symbols of DirectX already exist in WlgGen.obj, while some of strmbasd.lib seems to need some extra lib.
    Any suggestions where to search for removal of those symbols and which library might contain the last two symbols?

    PS: The temporary resolution for hardlocks with DXMedia 6.0 together with DirectX 9.0b and the NVidia Driver 61.76 is installing the graphics driver twice and the rest in a certain sequence. Because DXMedia contains the oldest libraries, this installation sequence worked for me:[list=1][*]Win98 SE[*]Nvidia Driver (just for resolution)[*]CTP2 (installs included DXMedia)[*]DXMedia 6.0 SDK[*]NVidia Driver remove/reinstall[*]DirectX 9.0b SDK[/list=1]

  • #2
    According to the MSDN library, SysAllocString and SysFreeString are from oleaut32.lib.

    Comment


    • #3
      thanks fromafar
      fixing the duplicate symbols was removing the #define INITGUID in wldgen.cpp and just making the ctp2 com stuff to be linked into wldgen.obj ...
      took some time to find that out, inbetween the duplicate symbols increased beyond 400

      Comment


      • #4
        Ok I have forgotten just about everything I knew 14 years ago about programming so a stupid question...

        Following the steps in ctplinuxfan's very helpful getting started guide I got as far as
        3.1.3.2 Start the build
        Run Build - CivCTP dbg.exe. Have yourself a break while the source compiles. This lasts about
        20 - 30 minutes, but will vary depending on your system.
        When I received the following error:
        Code:
        --------------------Configuration: Crater - Win32 Debug--------------------
        Compiling...
        Crater.cpp
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\dsound.h(305) : error C2146: syntax error : missing ';' before identifier 'dwReserved1'
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\dsound.h(305) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\dsound.h(305) : error C2501: 'dwReserved1' : missing storage-class or type specifiers
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\dsound.h(306) : error C2146: syntax error : missing ';' before identifier 'dwReserved2'
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\dsound.h(306) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\dsound.h(306) : error C2501: 'dwReserved2' : missing storage-class or type specifiers
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\mmstream.h(99) : error C2065: 'DWORD_PTR' : undeclared identifier
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\mmstream.h(99) : error C2146: syntax error : missing ')' before identifier 'dwParam'
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\mmstream.h(99) : error C2165: 'left-side modifier' : cannot modify pointers to data
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\mmstream.h(99) : error C2071: 'PAPCFUNC' : illegal storage class
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\mmstream.h(99) : error C2059: syntax error : ')'
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\mmstream.h(668) : error C2061: syntax error : identifier 'DWORD_PTR'
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\mmstream.h(809) : error C2061: syntax error : identifier 'DWORD_PTR'
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\strmif.h(1018) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\strmif.h(1018) : error C2378: 'DWORD_PTR' : redefinition; symbol cannot be overloaded with a typedef
        c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\strmif.h(1018) : fatal error C1004: unexpected end of file found
        Error executing cl.exe.
        
        CivCTP_dbg.exe - 16 error(s), 0 warning(s)
        HELP!
        ·Circuit·Boi·wannabe·
        "Evil reptilian kitten-eater from another planet."
        Call to Power 2 Source Code Project 2005.06.28 Apolyton Edition

        Comment


        • #5
          This looks like the kind of error you get when your include directories are in the wrong order - if they aren't already, you might try putting the DXMedia paths before the DirectX ones...

          Comment


          • #6
            Afterwards I added the changes concerning the DirectX stuff I had to change the directory order as well. Unfortunatly I get an error message about a missing component, unfortunatly the error message does not tell me which component is missing.

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

            Comment


            • #7
              Help, I've fallen and can't reach my beer....

              Following the steps in ctplinuxfan's very helpful Getting Started Guide, I did the following:
              • 2.1.2 Install Civilization Call to Power II
                - already done, now using playtest
              • 2.1.3 Install the CtP2 1.11 patch
                - already done, now using playtest
              • 2.1.4 Backup your CtP2 directory
                - did not do
              • 2.1.5 Install MS Visual C++ 6.0
                - installed Standard Edition, Service Pack 4 which came with it and MSDN Library that came with it. Downloaded and installed Visual Studio 6.0 Service Pack 6
              • 2.1.6.2 Alternative 2: Using the latest DirectX SDK
                - Downloaded and installed DirectX 9.0 Complete Software Development Kit (SDK) and then downloaded and installed DirectX 9.0 SDK Update - (October 2004) to a different folder because it forced me to.
                - The directories were already in the IDE options when I looked, Oct'04 first then complete then the VC directories.
                The DirectShow BaseClasses workspace file,
                ...\DirectShow\BaseClasses\baseclasses.dsw was only in the first DXSDK not the Oct'04 one. I successfully built the two .lib files and added the include directories under options.
                Should I download and install the other 2 DX 9.0 SDK Updates, and add them to the include directories?
              • 2.1.7 Optional: Install Simple DirectMedia Layer libraries
                - Did not do
              • 2.1.8 Unpacking the source
                - Already done.
              • 2.1.9 Setup your environment variables
                - Already done.
              • 2.1.10 Create a tmp directory
                - Already done.
              • 2.1.11 Reboot
                - Skipped
              • 2.1.12 Obtain latest ALL patch from CtP2 Source Code Project
                - 2004-09-13 All already added
              • 2.1.13 Optional: Get up to date until latest post
                - 1 or 2 alreaded added.
              • 3.1.3.1 Set the active configuration and 3.1.3.2 Start the build

              Code:
              --------------------Configuration: Crater - Win32 Debug--------------------
              Compiling...
              Crater.cpp
              Linking...
                 Creating library Crater_0/Crater.lib and object Crater_0/Crater.exp
              --------------------Configuration: fault - Win32 Debug--------------------
              Compiling...
              FaultGen.cpp
              Linking...
                 Creating library fault__0/fault.lib and object fault__0/fault.exp
              --------------------Configuration: geometric - Win32 Debug--------------------
              Compiling...
              FaultGen.cpp
              Geometric.cpp
              Linking...
                 Creating library geometr0/geometric.lib and object geometr0/geometric.exp
              --------------------Configuration: Plasma2 - Win32 Debug--------------------
              Compiling...
              PlasmaGen2.cpp
              Linking...
                 Creating library Debug/plasma2.lib and object Debug/plasma2.exp
              --------------------Configuration: dbgen - Win32 Debug--------------------
              Performing Custom Build Step on .\ctpdb.y
              'C:\Program' is not recognized as an internal or external command,
              operable program or batch file.
              Error executing c:\windows\system32\cmd.exe.
              
              CivCTP_dbg.exe - 1 error(s), 0 warning(s)

              OK something is having a problem with the space in 'Program Files'
              ·Circuit·Boi·wannabe·
              "Evil reptilian kitten-eater from another planet."
              Call to Power 2 Source Code Project 2005.06.28 Apolyton Edition

              Comment


              • #8


                I'm going to bed
                ·Circuit·Boi·wannabe·
                "Evil reptilian kitten-eater from another planet."
                Call to Power 2 Source Code Project 2005.06.28 Apolyton Edition

                Comment


                • #9
                  Performing Custom Build Step on .\ctpdb.y
                  Vovan and RalphTrickey pointed this out in the "Getting the source to compile"
                  thread:

                  Something I found out is that the custom build steps don't like spaces in your
                  path, like RalphTrickey said. I had the following error when building:
                  "C:/Documents" not found. Or something along these lines. The solution was to
                  copy the bison and yacc files into a folder with no spaces, like "C:\cdk_dir"
                  and put that into the CDKDIR environment variable

                  The next problem was that my sources were also in a path with spaces in it
                  And sure enough yacc didn't like it... And sure enough, into a directory with
                  no spaces the source went. That's a bit of copying around, but hey, I didn't
                  have to do the yacc and bison stuff manually.
                  I didn't notice that either and if you check that thread, you'll find me
                  banging my head against the screen some pages later wondering why it won't
                  work for me.

                  Anyway, when I set the project up as C:\Activision\CTP2\... it worked fine.

                  Comment


                  • #10
                    And now we do...



                    I reinstalled DirectX to C:\DX9SDK\
                    I reinstalled the CTP2 source to C:\CTP2code\

                    I get the same error!

                    My C++ is still in C:\Program Files\Microsoft Visual Studio\
                    Do I have to reinstall that to something like C:\VisualC\ ???
                    ·Circuit·Boi·wannabe·
                    "Evil reptilian kitten-eater from another planet."
                    Call to Power 2 Source Code Project 2005.06.28 Apolyton Edition

                    Comment


                    • #11
                      Re: And now we do...

                      Originally posted by Flinx


                      I reinstalled DirectX to C:\DX9SDK\
                      I reinstalled the CTP2 source to C:\CTP2code\

                      I get the same error!

                      My C++ is still in C:\Program Files\Microsoft Visual Studio\
                      Do I have to reinstall that to something like C:\VisualC\ ???
                      have you changed your cdkdir variable?

                      Comment


                      • #12
                        Doh!

                        ·Circuit·Boi·wannabe·
                        "Evil reptilian kitten-eater from another planet."
                        Call to Power 2 Source Code Project 2005.06.28 Apolyton Edition

                        Comment


                        • #13
                          Almost



                          Code:
                          Compiling...
                          c3cmdline.cpp
                          C:\CTP2code\ctp2_code\ctp\ctp2_utils\c3cmdline.cpp(6331) : error C2039: 'min' : is not a member of 'std'
                          C:\CTP2code\ctp2_code\ctp\ctp2_utils\c3cmdline.cpp(6331) : error C2065: 'min' : undeclared identifier
                          C:\CTP2code\ctp2_code\ctp\ctp2_utils\c3cmdline.cpp(6331) : error C2275: 'sint32' : illegal use of this type as an expression
                                  c:\ctp2code\ctp2_code\ctp\c3types.h(24) : see declaration of 'sint32'
                          SlicFunc.cpp
                          c:\ctp2code\ctp2_code\robot\aibackdoor\dynarr.h(351) : error C2589: '(' : illegal token on right side of '::'
                                  c:\program files\microsoft visual studio\vc98\include\utility(21) : while compiling class-template member function 'void __thiscall DynamicArray::ResizeCreate(const long,class MapPoint *& )'
                          c:\ctp2code\ctp2_code\robot\aibackdoor\dynarr.h(351) : error C2059: syntax error : '::'
                                  c:\program files\microsoft visual studio\vc98\include\utility(21) : while compiling class-template member function 'void __thiscall DynamicArray::ResizeCreate(const long,class MapPoint *& )'
                          slicfuncai.cpp
                          Foreigner.cpp
                          ProposalAnalysis.cpp
                          Generating Code...
                          Error executing cl.exe.
                          
                          CivCTP_dbg.exe - 5 error(s), 0 warning(s)
                          ·Circuit·Boi·wannabe·
                          "Evil reptilian kitten-eater from another planet."
                          Call to Power 2 Source Code Project 2005.06.28 Apolyton Edition

                          Comment


                          • #14
                            Did you try Rebuild All after that?

                            Solver had a similar error with std::max being undefined and sint32 errors, Fromafars suggestion to Rebuild All helped here

                            Anyway, i updated the documentation to contain the space problem.
                            If anybody else encounters that problem, he could try to quote the path in the CDKDIR variable, first, e.g.
                            Code:
                            set CDKDIR="C:\Program Files\CTP2 Source Directory"
                            or use the DOS 8.3 names (or both):
                            Code:
                            set CDKDIR="C:\PROGRA~1\CTP2~1"
                            Updated pdf is at this post, sources in altered source files thread.

                            Comment


                            • #15
                              I fixed CDKDIR and did do a rebuild all after I got thoses errors. I assume everything is working now. I got one error as a result of some code from calvitix. I'll fix that tonight and see if everything works.
                              ·Circuit·Boi·wannabe·
                              "Evil reptilian kitten-eater from another planet."
                              Call to Power 2 Source Code Project 2005.06.28 Apolyton Edition

                              Comment

                              Working...
                              X