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

  • Well I got a copy of MSV C++ 6.0 and the dsw works of course, but I noticed that the compile option is desensitized. I did do a build and it came back with 1 error. THis was just fooling around since I still have to download the DirectX SDks


    I will stil try to compile on DevC++ but I think my priority is to fix soome of the code I have. And I do think being able to compile will help me a lot in testing what I try to do.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • Okay I think I need some help. I read through many of the posts hear but cant really see a recent step by step compile with Microsoft Visual C++

      I did these steps:

      1) Updated the SVN trunk

      2) Downloaded the minimal version of 400kb

      3) Set up the environment variable (CDKDIR). See readme (Control Panel->System->Environment Variables). (I did reboot)

      4) Opened the project file of the source code(ctp2_code\ctp\civctp.dsw) in Microsoft Visual Studio 6.

      5) added the Include and Lib and classes/base directories from the DirectX SDKs to Tools->Options->Directories from Visual Studio, as described in the readme.

      How do I do this?
      6) Build the flex and byacc files manually, as described by John.

      7) I still onlyget a build and compile is desensitized. Do I need anything else?
      Last edited by Ekmek; June 21, 2005, 00:10.
      Formerly known as "E" on Apolyton

      See me at Civfanatics.com

      Comment


      • Originally posted by E
        2) Downloaded the minimal version of 400kb
        What's this? A small version of DirectX? Well I installed DirectX 9 that has everything and puts its files automaticly into the include file list of VS, maybe there is an include missing but that isn't a problem and maybe another modification to the project is necessary.

        Originally posted by E
        How do I do this?
        6) Build the flex and byacc files manually, as described by John.
        The best way is not doing it at all. These files should be compiled automaticly, espeacilly with the updated civctp.dsp.

        Originally posted by E
        7) I still onlyget a build and compile is desensitized. Do I need anything else?
        Werll that shouldn't be a problem even if DirectX is not installed. Did you select the ctp project as the active one?

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

        Comment


        • Originally posted by E
          7) I still onlyget a build and compile is desensitized. Do I need anything else?
          Compile is used for individual files, and will only be active when you have selected a .cpp or other compilable file.
          Build is used to make the whole project - it will automatically detect which files have been changed and need to be compiled. Just try it.

          Comment


          • Thanks. I did use the build function it said build ctp2_sdl.exe and I tried to build it but I received 5 errors but cant find where it put the ex so I assume it didn't build it. It happened real fast too so it made me thinkit didnt go through the files. I'll try again toight with Martin's suggestions.
            Formerly known as "E" on Apolyton

            See me at Civfanatics.com

            Comment


            • 5 errors is not bad, considering you are trying to build the wrong version. If you want the build a DirectX version, go to menu Build | Set Active Configuration, and select ctp2 - Win32 Debug (if you want a debug version) or ctp2 - Win32 Final (if you want to make the real thing). Then try to build again.

              Comment


              • Ok I change the config to ctp2 - Win32 final and got this:

                Code:
                --------------------Configuration: Crater - Win32 Final--------------------
                Compiling...
                Command line warning D4002 : ignoring unknown option '/Ot'
                Command line warning D4002 : ignoring unknown option '/Og'
                Command line warning D4002 : ignoring unknown option '/Oi'
                Command line warning D4002 : ignoring unknown option '/Op'
                Command line warning D4002 : ignoring unknown option '/Oy-'
                Crater.cpp
                ..\ui\aui_common\aui.h(74) : fatal error C1083: Cannot open include file: 'reftime.h': No such file or directory
                Error executing cl.exe.
                
                ctp2.exe - 1 error(s), 5 warning(s)
                then Debug I get this...
                Code:
                --------------------Configuration: Crater - Win32 Debug--------------------
                Compiling...
                Crater.cpp
                f:\my games\ctp2\svn-code\trunk\ctp2_code\ctp\ctp2_enums.h(25) : fatal error C1083: Cannot open include file: 'GameOver.h': No such file or directory
                Error executing cl.exe.
                
                CivCTP_dbg.exe - 1 error(s), 0 warning(s)


                I need a little help on the warnings. and 1 error sounds really low, do I have it accidently set to stop after one error or something? I assumed I'd get more...
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment


                • reftime.h is in [...]dxmedia\classes\base, so you may have to check step 5). It should be the first directory in the list when you select Include Files list at the Tools|Options Directories tab.

                  The error in ctp2_enums.h may be repaired by just removing the #include line. Actually, the whole file should be removed, and its contents redistributed, as the comment at the top indicates. I think the file has been introduced for a quick-and-dirty early linux compilation attempt, and was forgotten after splitting off the linux branch.

                  Comment


                  • Originally posted by E
                    Ok I change the config to ctp2 - Win32 final and got this:

                    Code:
                    --------------------Configuration: Crater - Win32 Final--------------------
                    Compiling...
                    Command line warning D4002 : ignoring unknown option '/Ot'
                    Command line warning D4002 : ignoring unknown option '/Og'
                    Command line warning D4002 : ignoring unknown option '/Oi'
                    Command line warning D4002 : ignoring unknown option '/Op'
                    Command line warning D4002 : ignoring unknown option '/Oy-'
                    Crater.cpp
                    ..\ui\aui_common\aui.h(74) : fatal error C1083: Cannot open include file: 'reftime.h': No such file or directory
                    Error executing cl.exe.
                    
                    ctp2.exe - 1 error(s), 5 warning(s)
                    Looks like the VC++ 6 newbe - I mean introductory version. There these warnings are normal. MS stripped all these cool optimize features from the compiler.

                    The error is from a missing DirectX include directory. From the menu bar go to Extras -> Options... -> Directories -> Include-Files and make sure that all the necessary DirectX directories are there. For instance here are the top most of mine:

                    C:\DXSDK9\Include
                    C:\DXSDK9\Samples\C++\DirectShow\BaseClasses
                    C:\Activision\CTP2\ctp2_code\compiler\msvc6\stlfix es

                    Of course this is for a DirectX 9 version. The reftime.h is in the BaseClasses directory. For DirectX 7 you need DXMedia.

                    Originally posted by E
                    then Debug I get this...
                    Code:
                    --------------------Configuration: Crater - Win32 Debug--------------------
                    Compiling...
                    Crater.cpp
                    f:\my games\ctp2\svn-code\trunk\ctp2_code\ctp\ctp2_enums.h(25) : fatal error C1083: Cannot open include file: 'GameOver.h': No such file or directory
                    Error executing cl.exe.
                    
                    CivCTP_dbg.exe - 1 error(s), 0 warning(s)
                    That is a nice side effect of one of the Linux changes. To fix this go to the menu bar Project -> Settings... There select the Crater project and insert into the project options the following piece:

                    /I "..\gs\gameobj"

                    right before

                    /I "..\os\include"

                    Do this for the other map plugin projects as well and the game should compile.

                    Unfortunatly I hadn't time to update all the projects with the necessary modifications, only the ones that I needed to compile and link the game again, therefore I didn't submit any changes yet.

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

                    Comment


                    • Why are these directories and ctp_enums.h included in crater.cpp? It does not use the enums at all. And GameOver? During map generation? The game has not even started yet!

                      @ E: Please tell us which versions of the compiler and DirectX you are using. Otherwise, you may get some confusing/conflicting advice.

                      Comment


                      • Originally posted by Fromafar
                        Why are these directories and ctp_enums.h included in crater.cpp? It does not use the enums at all. And GameOver? During map generation? The game has not even started yet!
                        I think it used to be using an enum from ctp2_enums.h, but (in the linux branch) I moved it to another file to remove the necessity for including ctp2_enums - I guess some of the change has filtered through to trunk, but not all of it.

                        Comment


                        • Ok, I downloaded the 186mb SDK and the dmweb thing in locutus's post on page 1. I then set the directories for the include and the library.

                          I'm using MS Visual C++ 6.0 and I now ihave the latest directX stuff from Locutus's post on the first page of this thread.

                          Martin, I found my matching directories that you had except:
                          C:\Activision\CTP2\ctp2_code\compiler\msvc6\stlfix
                          es
                          I don't see a compiler folder in svn-code...


                          Code:
                          --------------------Configuration: Crater - Win32 Final--------------------
                          Compiling...
                          Command line warning D4002 : ignoring unknown option '/Ot'
                          Command line warning D4002 : ignoring unknown option '/Og'
                          Command line warning D4002 : ignoring unknown option '/Oi'
                          Command line warning D4002 : ignoring unknown option '/Op'
                          Command line warning D4002 : ignoring unknown option '/Oy-'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4024 : unrecognized source file type '..\gs\gameobj', object file assumed
                          Command line warning D4027 : source file '..\gs\gameobj' ignored
                          Command line warning D4024 : unrecognized source file type '..\os\include', object file assumed
                          Command line warning D4027 : source file '..\os\include' ignored
                          Crater.cpp
                          Linking...
                             Creating library final/Crater.lib and object final/Crater.exp
                          --------------------Configuration: fault - Win32 Final--------------------
                          Compiling...
                          Command line warning D4002 : ignoring unknown option '/Ot'
                          Command line warning D4002 : ignoring unknown option '/Og'
                          Command line warning D4002 : ignoring unknown option '/Oi'
                          Command line warning D4002 : ignoring unknown option '/Op'
                          Command line warning D4002 : ignoring unknown option '/Oy-'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4024 : unrecognized source file type '..\gs\gameobj', object file assumed
                          Command line warning D4027 : source file '..\gs\gameobj' ignored
                          Command line warning D4024 : unrecognized source file type '..\os\include', object file assumed
                          Command line warning D4027 : source file '..\os\include' ignored
                          FaultGen.cpp
                          Linking...
                             Creating library fault__3/fault.lib and object fault__3/fault.exp
                          --------------------Configuration: geometric - Win32 Final--------------------
                          Compiling...
                          Command line warning D4002 : ignoring unknown option '/Ot'
                          Command line warning D4002 : ignoring unknown option '/Og'
                          Command line warning D4002 : ignoring unknown option '/Oi'
                          Command line warning D4002 : ignoring unknown option '/Op'
                          Command line warning D4002 : ignoring unknown option '/Oy-'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4024 : unrecognized source file type '..\gs\gameobj', object file assumed
                          Command line warning D4027 : source file '..\gs\gameobj' ignored
                          Command line warning D4024 : unrecognized source file type '..\os\include', object file assumed
                          Command line warning D4027 : source file '..\os\include' ignored
                          FaultGen.cpp
                          Geometric.cpp
                          Linking...
                             Creating library final/geometric.lib and object final/geometric.exp
                          --------------------Configuration: Plasma2 - Win32 Final--------------------
                          Compiling...
                          Command line warning D4002 : ignoring unknown option '/Ot'
                          Command line warning D4002 : ignoring unknown option '/Og'
                          Command line warning D4002 : ignoring unknown option '/Oi'
                          Command line warning D4002 : ignoring unknown option '/Op'
                          Command line warning D4002 : ignoring unknown option '/Oy-'
                          Command line warning D4002 : ignoring unknown option '/Ob2'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4002 : ignoring unknown option '/i'
                          Command line warning D4024 : unrecognized source file type '..\gs\gameobj', object file assumed
                          Command line warning D4027 : source file '..\gs\gameobj' ignored
                          Command line warning D4024 : unrecognized source file type '..\os\include', object file assumed
                          Command line warning D4027 : source file '..\os\include' ignored
                          PlasmaGen2.cpp
                          Linking...
                             Creating library final/plasma2.lib and object final/plasma2.exp
                          --------------------Configuration: dbgen - Win32 Final--------------------
                          Performing Custom Build Step on .\ctpdb.y
                          'F:\My' is not recognized as an internal or external command,
                          operable program or batch file.
                          Error executing c:\windows\system32\cmd.exe.
                          
                          ctp2.exe - 1 error(s), 45 warning(s)
                          I think the warnings are from the
                          /I "..\gs\gameobj"

                          right before

                          /I "..\os\include"
                          I added I may have put them in the wrong place. you siad project options, but project options is available under many tabs like C/C++ and Resources, MDL, and so on. THere are many tabs there ad Iadded them to all asuming thats what you meant by addingto other map plug-ins.

                          But the final error my come from the folder name I use F:\My Games\ and i think the space may have stopped it, is that right? how do I get around this (without renaming if I can?)
                          Formerly known as "E" on Apolyton

                          See me at Civfanatics.com

                          Comment


                          • I did find that ctp2 compilerf iler (i was looking at the old code in another folder) so I added it and then I only got this, which was stated previously:
                            [code]
                            --------------------Configuration: dbgen - Win32 Final--------------------
                            Performing Custom Build Step on .\ctpdb.y
                            'F:\My' is not recognized as an internal or external command,
                            operable program or batch file.
                            Error executing c:\windows\system32\cmd.exe.

                            ctp2.exe - 1 error(s), 0 warning(s)
                            [code]

                            how do I habdle this part?
                            Formerly known as "E" on Apolyton

                            See me at Civfanatics.com

                            Comment


                            • You must not put the source in a folder path which contains spaces.
                              Caution! Under no circumstances confuse the mesh with the interleave operator, except under confusing circumstances!
                              -Intercal reference manual

                              People often remark of me, "You say sorry far to much!". To which my common-sense reply is "I apologise".

                              Comment


                              • Originally posted by tombom
                                You must not put the source in a folder path which contains spaces.
                                You can, but you have to use the 8.3 versions of the names in the CDKDIR environment variable.
                                Last edited by J Bytheway; June 28, 2005, 12:23.

                                Comment

                                Working...
                                X