Announcement

Collapse
No announcement yet.

Compile the source code, missing headers

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

  • Compile the source code, missing headers

    Hello...

    I know that there are many threads about getting the source code compiled etc. I have read those and now I tried to compile the source code with MS Visual Studio .Net and I get the errors of missing header files (which are created by the dbgen, OrderRecord.h ...). There is already a thread about it, here: http://apolyton.net/forums/showthrea...ht=orderrecord
    But there is no solution for the problem.
    Maybe you now know one?

    I'm trying to compile this code for a few days now

    Can you help me?

    Regards,
    Jacqueline.

  • #2
    What kind of ctP2 are you trying to compile Ctp2 - final?

    My best guess so far. if Fromafar, Martin Guhmann, or J Bytheway come online they can probably help you more

    PS Welcome to Apolyton CtP2 --- hope you stick around.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • #3
      I downloaded the R422 CTP Source.

      Is there a newer version? If yes, where can I find this?

      Comment


      • #4
        Thats the latest 'download' however we are up to revision 563 and its accessible through an SVN Server at http://ctp2.darkdust.net/

        the revision reports are at http://www.apolyton.net/forums/showt...&goto=lastpost
        Formerly known as "E" on Apolyton

        See me at Civfanatics.com

        Comment


        • #5
          In the original MSVC6 project, some of the custom build steps of the .cdb files were missing when not building the Debug configuration. Workaround: when changing one of the .cdb files, always do a Debug build before doing one of the others (Release/Final).

          When opening the MSVC6 project file with a newer version (2003, 2005) of MSVC, the automatic conversion is not entirely flawless. You may have to insert or correct the placement of some double-quotes (") around variables like $(InputPath) and $(ProjectDir) in custom build steps. You have to verify this for all .cdb files (a lot ), but also for the Lex (.l) and Yacc (.y) files. When ctpdb.exe could not be generated (check this first!), the .cdb files can not be handled.

          Comment


          • #6
            Ok, here I am again...

            I still try to get the source code compiled with VS .NET 2003.
            After downloading the new version from the svn server (tags/2004-12-27), I opened the .dsw with VS. I removed some of the double quotes around variables like $(InputPath) and $(ProjectDir), also for all .l und .y files.
            After compiling I get only 5 errors... but I don't know how to fix them. Maybe you can help me...

            The errors are (I try to translate in english, sorry, if there are not correct):

            c:\Programme\DXMEDIA\classes\base\combase.h(249): error C2373: 'InterlockedExchange': Neudefinition; unterschiedliche Modifizierer
            (new definition, different modifier)

            c:\Programme\DXMEDIA\classes\base\combase.h(249): error C2491: 'InterlockedExchange': Definition von Funktion für dllimport nicht zulässig
            (definition of function for dllimport not valid)


            c:\ctp2\ctp2_code\ui\aui_ctp2\radarmap.cpp(639): error C2511: 'Pixel16 RadarMap::RadarTileBorderColor(const MapPoint &)': Ãœberladene Memberfunktion nicht in 'RadarMap' gefunden
            (overloaded memberfunction not found in RadarMap)


            c:\ctp2\ctp2_code\ui\aui_ctp2\radarmap.cpp(1058): error C2660: 'RadarMap::RadarTileBorderColor': Funktion akzeptiert keine 1 Argumente
            (function does not accept 1 arguments)


            c:\Programme\DXMEDIA\classes\base\combase.h(249): error C3861: 'InterlockedExchange': Bezeichner wurde auch mit einer argumentbezogenen Suche nicht gefunden
            (identifier not found with argument-oriented search)

            Can you help me?

            Does anyone use .Net to develop for ctp2? Or do you recommend t use VC++ 6.0?

            Regards,
            Jacqueline.

            Comment


            • #7
              I use visual C++ 6.0, not sure if anyone has done it with .Net.

              Also our latest SVN code should be May 16, 2006. I committed new stuff last night. Not sure where you got 12-27-2004. But maybe the errors are corrected in our current version
              Formerly known as "E" on Apolyton

              See me at Civfanatics.com

              Comment


              • #8
                Originally posted by jacquipre
                I still try to get the source code compiled with VS .NET 2003.
                After downloading the new version from the svn server (tags/2004-12-27)
                Don't download from tags/2004-12-27 download from /trunk instead. Those tags are very old, so don't use them.

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

                Comment


                • #9
                  OK.

                  I now installed MS Visual C++ 6.0, downloaded the last version (from the trunk directory). Then I compiled the project with 0 errors and 1 warning. I was happy!

                  Now, I didn't get the CivCTP_dbg.exe running...!

                  I installed the game to C:\Spiele\CallToPower2
                  I "installed" the sourcecode from svn to C:\ctp2

                  Now, I got the CivCTP_dbg.exe which is located in C:\ctp2\ctp2_code\ctp

                  I tried to start this .exe from this location and get an missing mss32.dll error. So I copied this .dll from my game directory (C:\Spiele\CallToPower2\ctp2_program\ctp) to the current directory (C:\ctp2\ctp2_code\ctp). Then, I got an error of a missing profile.txt. So I copied the whole ctp2_data folder form C:\Spiele\CallToPower2 to C:\ctp2. Now, the game starts, black screen ... waiting ... nothing happens ... a beep and another window named "Paths Error". But I couldn't read this window, I had to kill the game via the task manager.

                  So I tried the other way round. I copied the CivCTP_dbg.exe to C:\Spiele\CallToPower2\ctp2_program\ctp together with following .dlls:
                  anet2d.dll
                  gamewatch.dll
                  gwciv.dll
                  gwfile.dll
                  jpeg62.dll
                  libtiff3.dll
                  zlib1.dll

                  Now, I started the game again....black screen ... nothing happens...

                  If I start the game with MS Visual C++ 6.0, I also get the "Paths Error"-Window.

                  So, what did I wrong?
                  Maybe, I must wait longer...

                  Comment


                  • #10
                    this was the right way:
                    So I tried the other way round. I copied the CivCTP_dbg.exe to C:\Spiele\CallToPower2\ctp2_program\ctp together with following .dlls:
                    anet2d.dll
                    gamewatch.dll
                    gwciv.dll
                    gwfile.dll
                    jpeg62.dll
                    libtiff3.dll
                    zlib1.dll

                    Now, I started the game again....black screen ... nothing happens...

                    I think you need to add more than just dlls and the exe there all the files we changed for the game too

                    svn/trunk/ctp2_data/ is the folder they are under in the svn

                    and the exe also needs the *.map file in your C:\ctp2\ctp2_code\ctp

                    but if you copied over the svn stuff you need to update your svn back to the latest ones we have
                    Formerly known as "E" on Apolyton

                    See me at Civfanatics.com

                    Comment


                    • #11
                      I tried to start the game again, and I waited and waited and after about 2.5 minutes the game appears!

                      After that I copied the ctp2_data directory from the svn and the *.map files to my game directory.
                      I started ... waited (again 2.5 minutes) ... yeah, game appears. I could play. Jippiiii!!!

                      Is it normal, that the loading process takes so much time? Maybe, because it's a debug version...

                      However, it works. So I can play a little bit with the code...

                      Thanks,
                      for your help!

                      Comment


                      • #12
                        Yeah debug works real slow.

                        Welcome to the code! We look forward to more coders.

                        If you need any help looking for something let us know, I know my way around pretty well now.

                        If you haven't noticed already most game mechanics stuff is in ctp2_code/gs/gameobj

                        And any changes please post in the revision reports thread. Welcome aboard!
                        Formerly known as "E" on Apolyton

                        See me at Civfanatics.com

                        Comment


                        • #13
                          If you need any help looking for something let us know, I know my way around pretty well now.
                          Surely, I will.

                          Thanks...it's really nice here

                          Comment


                          • #14
                            Originally posted by jacquipre
                            So I tried the other way round. I copied the CivCTP_dbg.exe to C:\Spiele\CallToPower2\ctp2_program\ctp together with following .dlls:
                            That's a bad idea, because you have to do it everytime you compile the game and want to run it and you can't use the debugger this way. The right way is to copy the ctp2_data directory into the same directory where you find the ctp2_code directory. Say no if you are asked if any files should be overwritten.

                            I assume you run a German version of the game that means there are some things left.

                            Go to ctp2_code\ctp\ there is a file called civpaths.txt, open it with any editor of your choice it contains a line english replace it by german and the game runs in German.

                            And for the final version you have to make the CD check work. In ctp2_program\ctp there is a file called texture.dat copy it to ctp2_code\ctp and of course all the *.dll files CTP2 asks for.

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

                            Comment


                            • #15
                              MSVC 2003 should work. Some playtest releases have been generated with it. If you are using the original DirectX/DirectMedia files, you have to modify combase.h by hand. Look for the InterlockedExchange function and outcomment a couple of statements to make it look like:
                              Code:
                              #if defined(_MSC_VER) && (_MSC_VER >= 1300)
                              /* The standard InterlockedXXX functions do take volatiles */
                              #else
                              /* The standard InterlockedXXX functions won't take volatiles */
                              static inline LONG WINAPI InterlockedIncrement( volatile LONG * plong )
                              { return InterlockedIncrement( const_cast( plong ) ); }
                              
                              static inline LONG WINAPI InterlockedDecrement( volatile LONG * plong )
                              { return InterlockedDecrement( const_cast( plong ) ); }
                              
                              static inline LONG InterlockedExchange( volatile LONG * plong, LONG new_value )
                              { return InterlockedExchange( const_cast( plong ), new_value ); }
                              #endif

                              Comment

                              Working...
                              X