Results 1 to 19 of 19

Thread: Compile the source code, missing headers

  1. #1
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57

    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. #2
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    03:57
    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

  3. #3
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57
    I downloaded the R422 CTP Source.

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

  4. #4
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    03:57
    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

  5. #5
    Fromafar
    Prince
    Join Date
    25 May 2003
    Posts
    622
    Country
    This is Fromafar's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    13:57
    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.

  6. #6
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57
    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.

  7. #7
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    03:57
    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

  8. #8
    Martin Gühmann
    Administrator Martin Gühmann's Avatar
    Join Date
    02 Mar 2001
    Location
    Tübingen, Germany
    Posts
    7,254
    Country
    This is Martin Gühmann's Country Flag
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Local Date
    September 20, 2014
    Local Time
    12:57

    Post

    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!"

  9. #9
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57
    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...

  10. #10
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    03:57
    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

  11. #11
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57
    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!

  12. #12
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    03:57
    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

  13. #13
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57
    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

  14. #14
    Martin Gühmann
    Administrator Martin Gühmann's Avatar
    Join Date
    02 Mar 2001
    Location
    Tübingen, Germany
    Posts
    7,254
    Country
    This is Martin Gühmann's Country Flag
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Local Date
    September 20, 2014
    Local Time
    12:57

    Post

    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!"

  15. #15
    Fromafar
    Prince
    Join Date
    25 May 2003
    Posts
    622
    Country
    This is Fromafar's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    13:57
    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

  16. #16
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57
    Originally posted by Martin Gühmann


    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.
    Ok, I did it this way round, but now I get the following error message window while starting the .exe:
    "DB_Error: UNIT_MACHINEGUNNER not found in Unit database"

    I can click "Continue" and the game will run anyway.

    But what could be wrong?

    Thanks,
    Jacqui.

  17. #17
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    03:57
    Sorry,

    That was my error:

    see here:

    http://www.apolyton.net/forums/showt...87#post4459587
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  18. #18
    jacquipre
    Settler
    Join Date
    18 Apr 2006
    Posts
    10
    Country
    This is jacquipre's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    September 20, 2014
    Local Time
    11:57
    Ok, now the error is gone, but another occurs... maybe I'm too stupid ...

    If I start the game out of visual studio everything is ok, until I select New Game. Then the game is loaded but everything around the settlers is black and everything is very slow and some kind of blurred (?). I made a screenshot, because it's difficult to explain it.

    Sorry, if I asked that much ...

    -- Jacqui
    Attached Images Attached Images

  19. #19
    Martin Gühmann
    Administrator Martin Gühmann's Avatar
    Join Date
    02 Mar 2001
    Location
    Tübingen, Germany
    Posts
    7,254
    Country
    This is Martin Gühmann's Country Flag
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Local Date
    September 20, 2014
    Local Time
    12:57

    Post

    Originally posted by jacquipre
    If I start the game out of visual studio everything is ok, until I select New Game. Then the game is loaded but everything around the settlers is black and everything is very slow and some kind of blurred (?). I made a screenshot, because it's difficult to explain it.
    Actually this isn't a big big deal sometimes it happens to me, too, but only with the debug version compiled by the MSVC 6 introductory version. If you save the game and reload or reload from the autosave the problem should disappear.

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

Similar Threads

  1. COMPILE: Getting the source to compile
    By J Bytheway in forum CtP2 Source Code Project
    Replies: 307
    Last Post: March 29, 2011, 16:39
  2. PROBLEM: Raw Source Code Files Missing!
    By Mazaika in forum CtP2 Source Code Project
    Replies: 19
    Last Post: October 26, 2007, 20:03
  3. COMPILE: Getting the source to compile on VS.NET
    By vovan in forum CtP2 Source Code Project
    Replies: 62
    Last Post: July 8, 2004, 00:25
  4. Can't compile FreeCiv-SDL from cvs source
    By thethawav in forum Freeciv
    Replies: 3
    Last Post: March 29, 2003, 07:23
  5. Javadoc Documentation for current source / + current source code
    By Mark_Everson in forum Clash of Civilizations
    Replies: 0
    Last Post: September 17, 2000, 14:15

Bookmarks

Posting Permissions