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.

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.

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.

I downloaded the R422 CTP Source.
Is there a newer version? If yes, where can I find this?

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

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.

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.

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

Don't download from tags/2004-12-27 download from /trunk instead. Those tags are very old, so don't use them.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)
-Martin
Civ2 military advisor: "No complaints, Sir!"

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...

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

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!

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!

Surely, I will.If you need any help looking for something let us know, I know my way around pretty well now.
Thanks...it's really nice here![]()

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

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

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

Sorry,
That was my error:
see here:
http://www.apolyton.net/forums/showt...87#post4459587

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

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.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.
-Martin
Civ2 military advisor: "No complaints, Sir!"
Bookmarks