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

  • Originally posted by aoanzhishu
    I hope someone can send mss32.lib to me,I need it,thank you!
    Why do you want to have this file? It is included in the latest revision you can get from the repository. Then you just have to look for he Apolyton CTP2 Source Code_Readme.txt and follow its instructions. That's all.

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

    Comment


    • I'm rebuilding after losing a hard drive.

      I've downloaded the Dxmedia files but can't find the DXMEDIA\CLASSES\BASE folder. Can anyone help?

      Comment


      • Originally posted by Peter Triggs
        I'm rebuilding after losing a hard drive.

        I've downloaded the Dxmedia files but can't find the DXMEDIA\CLASSES\BASE folder. Can anyone help?
        Why do you need the DXmedia files? They are already part of DirectX. And for the rest I refer to the "Apolyton CTP2 Source Code_Readme.txt" you can get from the repository.

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

        Comment


        • Originally posted by Martin Gühmann
          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
          I saved an old version of the source code that I'd been working on, but not the Microsoft stuff. I went back to Mr Ogre's post and followed his instructions (just like 4 years ago). Except that there seem to be some "C:\DXMedia\classes\base" headers that you have but I don't.

          Comment


          • Originally posted by Peter Triggs
            I saved an old version of the source code that I'd been working on, but not the Microsoft stuff. I went back to Mr Ogre's post and followed his instructions (just like 4 years ago). Except that there seem to be some "C:\DXMedia\classes\base" headers that you have but I don't.
            OK, that is a reason to continue with the old stuff. If I remember correctly I used DXMedia 6 and DirectX 7 four years ago. Since then I moved to DirectX 9 from December 2005. In DirectX 9 you find the headers you are missing in such a directory:

            D:\DXSDK9\Samples\C++\DirectShow\BaseClasses

            And with DirectX 9, DXMedia is superflous. Unfortunately I don't know whether the earlier versions of the source code can be compiled against DirectX 9.

            If you cannot find the missing directory you could compile the source code and search for the files the compiler is missing. Then you can include the directories of the files the windows search has come up with.

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

            Comment


            • Right, that explains it. I should have just done a search on my computer for one of those headers that you mentioned. I have DirectX 8.1 and it turns out they're in

              C:\DXSDK\Samples\Multimedia\DirectShow\BaseClasses

              Thanks, Martin.

              Comment


              • Compiling a release version

                Hi,

                I hope you can help. I got the 875 version through the svn link. I followed the instructions earlier in this thread and I am able to get the debug version to compile with no errors and no warnings. However, when I try to compile a release version it starts to compile and fails when it gets to:
                Performing Custom Build Step on ..\gs\newdb\unitpromotion.cdb. I get a Windows message saying ctpdb.exe has encountered a problem and needs to be stopped. If I click on the debug button it starts the VC6 debugger and the message it displays is Unhandled Exception 0xC0000005 Access Violation.

                I went through the steps to change all the dll files to Win32Release configurations. Then set the active configuration for dbgen to Win32Release and built the ctpdb.exe program. I get the error when I switch the ctp2 active configuration to Win32Release and attempt to build ctp2r.exe.

                I am using VC6, on a Windows XP SP2 machine with 3 GB of ram and a core duo 2.67 gHz processor.

                Comment


                • Re: Compiling a release version

                  Originally posted by RobertC5614
                  I hope you can help. I got the 875 version through the svn link. I followed the instructions earlier in this thread and I am able to get the debug version to compile with no errors and no warnings. However, when I try to compile a release version it starts to compile and fails when it gets to:
                  Performing Custom Build Step on ..\gs\newdb\unitpromotion.cdb. I get a Windows message saying ctpdb.exe has encountered a problem and needs to be stopped. If I click on the debug button it starts the VC6 debugger and the message it displays is Unhandled Exception 0xC0000005 Access Violation.
                  Actually this shouldn't happen, has I can see for the unitpromotion.cdb there is also no difference between debug and release version. Anyway, you should compile the final version, the version Activision used for release. So far on my computer the final version didn't produce any problems of that sort.

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

                  Comment


                  • Re: Re: Compiling a release version

                    Originally posted by Martin Gühmann


                    Actually this shouldn't happen, has I can see for the unitpromotion.cdb there is also no difference between debug and release version. Anyway, you should compile the final version, the version Activision used for release. So far on my computer the final version didn't produce any problems of that sort.

                    -Martin
                    Thanks for replying. I did set the configuration to Win32 Final and when I tried to build I got the same error, except on Wonder.cdb this time. I went into the configurations for the ctpdb.exe program and looked for differences between the debug and final/release versions. I turned off the optimizations for the final configuration of ctpdb.exe and rebuilt it. I then set the ctp2 configuration to final and rebuilt it, and it worked!

                    Apparently when my computer builds the ctpdb.exe one of the things it wants to 'optimize' seems to break it.

                    Now that I know I can build the program I can look through it and see if I can help. Should be no problem... Yeah right I will try to help but I am just learning to program so I don't know how much help I will be.

                    Comment


                    • Which version of the DirectX SDK do I need to download?

                      I tried the latest (June 2008) but it didn't have the DirectShow/BaseClasses folders or any DirectShow stuff.

                      Then I tried "Windows SDK for Windows Server 2008 and .NET Framework 3.5", this has the DirectShow/BaseClasses folder but not the Debug_Unicode subfolder or anything similar.
                      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                      CtP2 AE Wiki & Modding Reference
                      One way to compile the CtP2 Source Code.

                      Comment


                      • Yes, Microsoft moved that into the windows SDK, and you have to compile strmbasd.lib yourself, in older versions of DirectX it was already compiled.

                        Do compile it, open the project file in Viusal Studio, by double clicking on baseclasses.sln or baseclasses.vcproj. Then the project is opened in Visual Studio, you have to make sure that the active configuration is set to debug. To check this you have in Visual Studio to click on Build and then Configuration Manager. And the following dialog should be self explanatory.

                        Then you have to compile the file. The compiler will generate the strmbasd.lib in a Debug subfolder, which you have to include instead of the Debug_Unicode folder.

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

                        Comment


                        • OK thanks I did that.

                          I compiled and it said I still had dinput.h and dsound.h missing from my include directory but I found them in another older DXSDK and pasted them into my include folder (I assume this is OK).

                          Now I have a few errors left, this seems to be the main one, appearing when trying to compile each of the 6 projects:

                          ------ Build started: Project: fault, Configuration: Final Win32 ------
                          Linking...
                          .\FaultGen.def(2) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
                          Creating library .\fault__3/fault.lib and object .\fault__3/fault.exp
                          Embedding manifest...
                          Project : error PRJ0003 : Error spawning 'mt.exe'.
                          Build log was saved at "file://C:\CTP2\ctp2_code\mapgen\fault__3\BuildLog.htm"
                          fault - 1 error(s), 1 warning(s)
                          This is the "command line" part from the build log for fault (if it's any use):

                          Creating temporary file "C:\CTP2\ctp2_code\mapgen\fault__3\RSP0000072700353 6.rsp" with contents
                          [
                          /OUT:"..\ctp\dll\map\fault.dll" /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:".\fault__3\fault.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEF:".\FaultGen.def" /PDB:".\fault__3/fault.pdb" /MAP:".\fault__3/fault.map" /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /IMPLIB:".\fault__3/fault.lib" /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

                          ".\fault__3\FaultGen.obj"
                          ]
                          Creating command line "link.exe @C:\CTP2\ctp2_code\mapgen\fault__3\RSP000007270035 36.rsp /NOLOGO /ERRORREPORT:PROMPT"
                          Creating temporary file "C:\CTP2\ctp2_code\mapgen\fault__3\RSP0000082700353 6.rsp" with contents
                          [
                          /outputresource:"..\ctp\dll\map\fault.dll;#2" /manifest

                          .\fault__3\fault.dll.intermediate.manifest
                          ]
                          Creating command line "mt.exe @C:\CTP2\ctp2_code\mapgen\fault__3\RSP000008270035 36.rsp /nologo"
                          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                          CtP2 AE Wiki & Modding Reference
                          One way to compile the CtP2 Source Code.

                          Comment


                          • Originally posted by Maquiladora
                            OK thanks I did that.

                            I compiled and it said I still had dinput.h and dsound.h missing from my include directory but I found them in another older DXSDK and pasted them into my include folder (I assume this is OK).

                            Well, in this case I would use the whole DXSDK, but you could search for them in the internet or you may start in the windows SDK first.

                            Originally posted by Maquiladora
                            Now I have a few errors left, this seems to be the main one, appearing when trying to compile each of the 6 projects:
                            So far I found this:



                            If this doesn't help we have to find something else, all I can say is that I hadn't any problems on my computer with Visual Studio 2008.

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

                            Comment


                            • The "Error spawning 'mt.exe'" problem seems to have been because I didn't have mt.exe in any of my executable directories. I tested it by tranferring the file from an older version SDK to one of my directories and it fixed the problem.

                              Also now I downloaded the whole latest Windows SDK and reinstalled it fresh, and that also included the mt.exe so that is no longer a problem. I didn't download it all before as it's quite big, but I didn't have to sit around waiting for it today as I was busy, so it was easy.

                              Even still dsound.h and dinput.h were still missing on my first attempt, so I had to borrow them from an earlier DXSDK.

                              So I compiled again, ctp2 fails miserably with 234 errors and 1 warning, dbgen has 42 warnings but no errors, and the rest 1 warning and no errors.

                              I've attached the whole output.

                              Also just to clarify, which file do you open, the project or the workspace? And also what about the popups when you open either of those files, it asks if I want to "permanently remove the source control bindings", I have no idea what that is, but either choice seems to make no difference.

                              It's not very clear to a newbie, but of course I haven't had time to do a lot of searching for answers yet.

                              And now I'm going to bed.
                              Attached Files
                              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                              CtP2 AE Wiki & Modding Reference
                              One way to compile the CtP2 Source Code.

                              Comment


                              • Even still dsound.h and dinput.h were still missing on my first attempt, so I had to borrow them from an earlier DXSDK.

                                So I compiled again, ctp2 fails miserably with 234 errors and 1 warning, dbgen has 42 warnings but no errors, and the rest 1 warning and no errors.
                                The warnings for dbgen are Microsoft inventions. Adding _CRT_SECURE_NO_WARNINGS and _CRT_NONSTDC_NO_WARNINGS to the preprocessor definitions should get rid of those.

                                The single warning with each map generator can be solved by removing 1 line from the Module Definition file. I will add the modified file to the archive.

                                It looks like there are only 2 main errors when compiling ctp2.
                                Firstly, you have to check some of the database files (specifically: RiskRecord, PollutionRecord, and MapRecord). It looks like these have not been (re)generated correctly.
                                Secondly, there are some errors in refclock.h. Those are probably caused by your manual mixing of new Windows Platform SDK and old DXSDK files. Better remove the borrowed files, and check that your include and library paths are correct and complete.

                                Also just to clarify, which file do you open, the project or the workspace?
                                The dsp and dsw files are old MSVC6 files. When you use a newer version of Visual Studio, these will be converted to a new format, and some new files (sln and vcproj) should be created automatically. After conversion, you should forget about the old files, and open only the sln file.

                                And also what about the popups when you open either of those files, it asks if I want to "permanently remove the source control bindings", I have no idea what that is, but either choice seems to make no difference.
                                Removing the bindings is OK. These were used to access the in-house VCS source code control system at Activision.

                                Comment

                                Working...
                                X