I think the instructions above are now complete.

Well done on getting this farOriginally posted by arrow014
Ok, I finally found some time to start working on this on my Mandriva 2006 partition. I downloaded, built and installed SVN, checked out the source, ran autoconf, got errors, installed autoconf and automake packages, ran ./configure, got errors, installed the byacc package, ran ./configure and it seems to get through just about everything fine now;.
Yes, this is a real problem. I ran into it myself, but then forgot about it. The problem is this: The configure script is set to run a "child" configure script to do the configuring for the anet library. Now, when it tries to run this configure script for anet, it finds that the script isn't there. It tries to compensate by running a "generic" configure script in "ctp2_code/os/autoconf/config/" (this is the directory it was told to look for such things), but there is no such script (installing enough packages might make this generic script exist - it might even make it do the right thing, but I wouldn't count on it). Unfortunately this fallback behaviour makes the error message somewhat obscure. Anyway, the solution is to go to the ctp2_code/libs/anet directory and create the configure script (by running automake, etc. You can probably get away with simply running "../../../autogen.sh")it generates a bunch of makefiles and then gives me a slightly wierd error:
...
config.status: creating ctp2_code/ui/Makefile
config.status: creating ctp2_code/ui/interface/Makefile
config.status: creating ctp2_code/os/include/config.h
config.status: executing depfiles commands
configure: configuring in ctp2_code/libs/anet
configure: running /bin/sh ctp2_code/os/autoconf/config/configure --prefix=/usr/local --cache-file=/dev/null --srcdir=.
/bin/sh: ctp2_code/os/autoconf/config/configure: No such file or directory
configure: error: /bin/sh ctp2_code/os/autoconf/config/configure failed for ctp2_code/libs/anet
Not sure what to do about this...is it really a problem? If so, any ideas what I need to do to fix it?
I'm glad you're getting the hang of thingsActually, I'm rather proud of myself for getting this far by myself...I really haven't had much success building stuff from sources in the past, but I've been learning a lot about Linux development lately and it's starting to work a lot better.![]()
. Learning to use these autotools (especially understanding their error messages) can be an uphill struggle. Tip for the day: when you get a strange error, look up for the last non-strange line. In this case, the line that tells you what's really going wrong was
Of course, identifying the last non-strange line can be tough!Code:configure: configuring in ctp2_code/libs/anet
Tomorrow I'll try to get around to finishing those instructions in the post above (and adding a note about this problem), but once you've done those which are there, you should at least be able to get to the ctp2 main menu. Let me know if anything else stumps you.

I think the instructions above are now complete.

Hi,
congratulations that you got the game running so far!I wish i could do a bit more atm, than reading this great news...
Regarding the child configure problem: I *think* i commited a change to the Makefile, i.e. running eitherorCode:make bootstrapwithin the top source directory should do the trick.Code:make bootstrap-anet
Sorry, if i forgot to mention it.
As far as i can tell, we now have everything of Johannes Sixt patch included.
What i remember to be also put on todo/plan is:
[list=1][*]serialization: CTP2 uses a platform dependent form of serialisation, so for saving/loading games a format exchangable over different platforms would be great. If it works for now, definititely prio below input implementation.[*]add the patch to repository (for review)[*]look over type cast carefully;
Seems what i feared is correct, i.e. most void * casts are meant to be to a target uint32 value, not a value referenced by an uint32 ptr, as i hoped. This could mean, that an uint32 is sometimes used to effectively store an address, i.e. a pointer to something.Whenever you see a crash when dereferencing a pointer cast to uint32 *, try to pass the pointer around or for a quick workaround cast to uint32 again. My vague guess is that this is a hack to provide a kind of unique id of an instance of an object. If so, an UUID algorithm placed somewhere (e.g. in ID class) could be an alternative.
When an uint32 is used to store pointers to instances, perhaps we'll stumble over back-casts to origin type as well.[/list=1]

Aha! That did the trick. Now ./configure finishes fine, but make got hung up looking for flex, so I installed it from the Mandriva repository and make hummed along nicely until it hit ctp2_code/gfx/gfx_utils/tiffutil.cpp, where it complains about not seeing the header file tiffio.h. I noticed that this file was in the /ctp2_code/libs/tiff folder, so I copied that file to the other directory and it seemed to work ok. It also complained about tiff.h, so I did the same thing for that file. Then it couldn't find d3des/d3des.h, md5/global.h or md5/md5.h in ctp2_code/libs/anet/src/3rdparty/ while compiling ctp2_code/libs/anet/src/tca/tca.c. I noticed the zip files md5.zip and d3des.zip in one of those directories so I unzipped those and that stopped the complaints about the header files. Now it gives me the message "cc1: warnings being treated as errors" and about ten similar warnings, so it quits. I tried to look through the makefile in ctp2_code/libs/anet/src/linux/dp to see what I could do (maybe get rid of a -Werror somewhere?) but I couldn't figure it out (I told you--I'm rather new to this...). Any ideas on what I need to do next?Regarding the child configure problem: I *think* i commited a change to the Makefile, i.e. running eitherorCode:make bootstrapwithin the top source directory should do the trick.Code:make bootstrap-anet
Sorry, if i forgot to mention it.
Examples of warnings:
../../tca/tca.c: In function 'tca_pwchange_generate':
../../tca/tca.c:368: warning: passing argument 1 of 'des2key' discards qualifiers from pointer target type
../../tca/tca.c:369: warning: passing argument 1 of 'Ddes' discards qualifiers from pointer target type
../../tca/tca.c:378: warning: passing argument 1 of 'D2des' discards qualifiers from pointer target type
I go for my third chemo treatment on Wednesday (Nov 16th) so I'll probably be out of commission for a while again, but I'll get back to this eventually... ;-)
Thanks so much for all the help so far!

I'm fairly sure I've seen this trick used to pass quantities of gold (the uint32 cast to a void*, passed, and then at its destination cast back to a uint32). Such cases can't be passed be reference (at least, not easily), because it would involve taking the reference of a temporary or local variable or allocating and deallocating memory.Originally posted by ctplinuxfan
look over type cast carefully;
Seems what i feared is correct, i.e. most void * casts are meant to be to a target uint32 value, not a value referenced by an uint32 ptr, as i hoped. This could mean, that an uint32 is sometimes used to effectively store an address, i.e. a pointer to something.Whenever you see a crash when dereferencing a pointer cast to uint32 *, try to pass the pointer around or for a quick workaround cast to uint32 again. My vague guess is that this is a hack to provide a kind of unique id of an instance of an object. If so, an UUID algorithm placed somewhere (e.g. in ID class) could be an alternative.
When an uint32 is used to store pointers to instances, perhaps we'll stumble over back-casts to origin type as well.

Try to install the dev package for the tiff library, it should contain the headers. It's most likely called libtiff-dev, libtiff-devel, tiff-dev, tiff-devel or something like that. The tiff headers in repository are for the windows build (maybe outdated/not match your tiff library version).Originally posted by arrow014
Aha! That did the trick. Now ./configure finishes fine, but make got hung up looking for flex, so I installed it from the Mandriva repository and make hummed along nicely until it hit ctp2_code/gfx/gfx_utils/tiffutil.cpp, where it complains about not seeing the header file tiffio.h.
Thanks, i oversaw this, because i have dev-files for md5/d3des also installed. I corrected the GNUMakefile.am accordingly.Then it couldn't find d3des/d3des.h, md5/global.h or md5/md5.h in ctp2_code/libs/anet/src/3rdparty/ while compiling
I'm certainly sure it's due to the missing dependencies fixed in r496, because after unzipping, the d3des.const patch must be applied, too.Examples of warnings:
../../tca/tca.c: In function 'tca_pwchange_generate':
../../tca/tca.c:368: warning: passing argument 1 of 'des2key' discards qualifiers from pointer target type
It should work now again, but by runningwithin the 3rdparty directory, you can get it working on r495 and before, either.Code:make clean ; make unpack

Well, it's great that it works now!Originally posted by J Bytheway
I'm fairly sure I've seen this trick used to pass quantities of gold (the uint32 cast to a void*, passed, and then at its destination cast back to a uint32). Such cases can't be passed be reference (at least, not easily), because it would involve taking the reference of a temporary or local variable or allocating and deallocating memory.
Maybe we can improve it later or at least use size_t or long for that purpose, because uint32 isn't large enough to store an address on all platforms.

I don't think that's a problem. I think the problem would occur if a void* were not big enough to store a uint32... Of course, that's just based on the couple of examples I've seen. Perhaps there are other places where the reverse holds.Originally posted by ctplinuxfan
Well, it's great that it works now!
Maybe we can improve it later or at least use size_t or long for that purpose, because uint32 isn't large enough to store an address on all platforms.

Ugh...chemo was !@#* this time...I was out for a whole week with nausea, headaches, sore muscles, etc etc. Oh, well, enough complaining, I guess, God knows it's better than dying of cancer.
And only three more to go (hopefully).
Anyway...back to the current quest...
Ok, that worked, sweet. A few more minutes of successful compilations flying up my screen later, it stops yet again with:Originally posted by ctplinuxfan
It should work now again, but by runningwithin the 3rdparty directory, you can get it working on r495 and before, either.Code:make clean ; make unpack
Doing a quick 'find -name "SDL_image.h"' doesn't come up with anything in the whole ctp2 directory structure...so maybe I'm missing another library...some TGA lib, perhaps?ui/aui_ctp2/c3imageformats.cpp:46:23: error: SDL_image.h: No such file or directory
ui/aui_ctp2/c3imageformats.cpp: In member function 'virtual AUI_ERRCODE TargaImageFormat::Load(const tchar*, aui_Image*)':
ui/aui_ctp2/c3imageformats.cpp:171: error: 'IMG_Load' was not declared in this scope
make[1]: *** [c3imageformats.o] Error 1
make[1]: Leaving directory `/usr/src/ctp2/ctp2_code'
make: *** [all-recursive] Error 1
Happy Thanksgiving to all!
-- Michael

You need to install the SDL library (look for packages named libsdl*). Under Debian this is split into many packages, so if you're in a similar situation then use your package management tools to get the one with that file in.

Got it. Next problem:Originally posted by J Bytheway
You need to install the SDL library (look for packages named libsdl*). Under Debian this is split into many packages, so if you're in a similar situation then use your package management tools to get the one with that file in.
No idea what to do here...it sounds like something's missing from a makefile somewhere or something...make[2]: *** No rule to make target `gfx/layers/libgfxlayers.la', needed by `ctp2'. Stop.

Check ctp2_code/gfx/Makefile.am Does it mention 'layers' in SUBDIRS? It should. My copy managed to lose its reference to layers - I don't know how. Things have got rather confused in my working copy, so I'm not sure exactly what's in the repository any more...

Is there no way on Linux to check for modifications in your working copy? TortoiseSVN has, in fact it generates a list of all the files you have modified and you can inspect them with the diff viewer.Originally posted by J Bytheway
Check ctp2_code/gfx/Makefile.am Does it mention 'layers' in SUBDIRS? It should. My copy managed to lose its reference to layers - I don't know how. Things have got rather confused in my working copy, so I'm not sure exactly what's in the repository any more...
-Martin
Civ2 military advisor: "No complaints, Sir!"

Nope, it was missing, so I added it to Makefile.am and Makefile, too. I guess I'm still a little fuzzy as to the relationship between these two files, because it didn't work after modifying just the Makefile.am file, but it did work after modifying the Makefile itself. I'm guessing the .am file is involved in the generation of the Makefile (perhaps in that autogen.sh script that I ran at the beginning?). Is that correct?Originally posted by J Bytheway
Check ctp2_code/gfx/Makefile.am Does it mention 'layers' in SUBDIRS? It should. My copy managed to lose its reference to layers - I don't know how. Things have got rather confused in my working copy, so I'm not sure exactly what's in the repository any more...
Anyway, after that it makes it to what looks like the final step--or close to it (I've omitted some of this output because it's so long):
TTF? True Type Font? I've installed several font libraries and packages...I'm not sure what would be missing, unless it's something specific to this project. Any links?g++ {compiler options} -o ctp2 {libraries and object files including -lttf}
/usr/bin/ld: cannot find -lttf
{make exit messages}
Dohhh.....after all this I feel like I'm so close!!!![]()

There is a way, normally, but my working copy is really messed up. It seems to be completely impossible to update it. I think I need to remove it and start again with a new copy.Originally posted by Martin Gühmann
Is there no way on Linux to check for modifications in your working copy? TortoiseSVN has, in fact it generates a list of all the files you have modified and you can inspect them with the diff viewer.

The autogen script (in particular, automake) generates a Makefile.in from each Makefile.am, and then the configure script generates a Makefile from each Makefile.in. So, so get the "proper" version of this makefile you'd need to run autogen.sh (or make bootstrap) again, and then configure again.Originally posted by arrow014
Nope, it was missing, so I added it to Makefile.am and Makefile, too. I guess I'm still a little fuzzy as to the relationship between these two files, because it didn't work after modifying just the Makefile.am file, but it did work after modifying the Makefile itself. I'm guessing the .am file is involved in the generation of the Makefile (perhaps in that autogen.sh script that I ran at the beginning?). Is that correct?
ttf is indeed true type font. The package needed in Debian is called libttf2. In any case you want a package with these files:Anyway, after that it makes it to what looks like the final step--or close to it (I've omitted some of this output because it's so long):
TTF? True Type Font? I've installed several font libraries and packages...I'm not sure what would be missing, unless it's something specific to this project. Any links?
If there is no such package then I guess you'll have to find some source code somewhere and install it the hard way, but I strongly suspect that there will be one.Code:/usr/lib/libttf.a /usr/lib/libttf.la /usr/lib/libttf.so

Ah, so that's why. That makes sense. Thanks.Originally posted by J Bytheway
The autogen script (in particular, automake) generates a Makefile.in from each Makefile.am, and then the configure script generates a Makefile from each Makefile.in. So, so get the "proper" version of this makefile you'd need to run autogen.sh (or make bootstrap) again, and then configure again.
Ok I found a "freetype2-devel" lib that I hadn't installed and that seemed to do the trick.Originally posted by J Bytheway
ttf is indeed true type font. The package needed in Debian is called libttf2. In any case you want a package with these files:
W00t! Make now finishes!Now THERE'S a reason for Thanks-giving...
I went through your "post-build" instructions (initial run, modifying userprofile.txt, copying files, etc.) as best I could--I must have done something wrong, though, because the game still won't launch:
FYI, I have the full game installed on a fat32 partition (path: /mnt/shared/Games/Call To Power) and I have the Linux source in /usr/src/ctp2, so the relative path I put in userprofile.txt was "../../../../../mnt/shared/Games/Call\ To\ Power\ 2/ctp2_data/".../ctp2 nointromovie
Messagebox(Paths Error): 'controlpanel.ldl' not found in asset tree.
/usr/src/ctp2/ctp2_data/english/uidata/layouts/civ3.ldl:43: syntax error
Messagebox(LDL Error): /usr/src/ctp2/ctp2_data/english/uidata/layouts/civ3.ldl:43: syntax error
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
Segmentation fault

Originally posted by arrow014
W00t! Make now finishes!Now THERE'S a reason for Thanks-giving...
![]()
Two things:I went through your "post-build" instructions (initial run, modifying userprofile.txt, copying files, etc.) as best I could--I must have done something wrong, though, because the game still won't launch:
FYI, I have the full game installed on a fat32 partition (path: /mnt/shared/Games/Call To Power) and I have the Linux source in /usr/src/ctp2, so the relative path I put in userprofile.txt was "../../../../../mnt/shared/Games/Call\ To\ Power\ 2/ctp2_data/".
- I said that you could omit the first path if it was "../../ctp2_data". This is not in fact true. If you omit it it will be automatically added *after* the other one, where in fact it's needed *before* the other one. So, put that in if you're missing it.
- The escaped spaces may be giving you grief. Try using just ' ' rather than '\ '. If that doesn't work, then rename the "Call To Power 2" directory to something without spaces in it.

Ok I added the first path and changed the directory name to just "ctp2" and now I'm getting:
../ctp2 nointromovie
Messagebox(Targa Load Error): Unable to find the file 'UC088.rim'
Failed loading times.ttf
ctp2: ui/aui_common/aui_textbase.cpp:415: void aui_TextBase::TextReloadFont(): Assertion `m_textfont != __null' failed.
Aborted

Yes, sure. Thought you meant the opposite.Originally posted by J Bytheway
I don't think that's a problem. I think the problem would occur if a void* were not big enough to store a uint32... Of course, that's just based on the couple of examples I've seen. Perhaps there are other places where the reverse holds.
Sure there is, e.g. on command line by svn status and svn diff. I guess John has his .svn dirs messed up, because he says it doesn't work? If so, try this:Originally posted by Martin Gühmann
Is there no way on Linux to check for modifications in your working copy?
[list=1][*]in broken wc, make a tar of it with .svn dirs in exclude list[*]in broken wc excute: grep revision .svn/entries[*]checkout that revision again: svn co -r revision ... target[*]maybe backup the new checkout at target[*]cd target[*]untar the backup of the broken working copy on the new checkout[*]run svn update[*]run svn status, svn diff, etc. as before, and merge manually (perhaps svn revert some stuff which was outdated on your broken wc)[/list=1]

I'm not sure about the message about UC088.rim.
There was a problem with the font search system which I fixed this morning - I'll upload that in a moment. Checkout that and see if it helps.
If not, Check whether you have a times.ttf anywhere on your system. If not, then you'll need to install it somehow (the Debian package is msttcorefonts; there's also a website somewhere - this issue was discussed earlier in this thread).
If you do have it, and it's not being found, then tell me where it is and I can fix the font search system to find it (or tell you how to do that).

Perhaps you are missing the corefonts package (perhaps named similar, it includes times.ttf, arial.ttf, e.t.c.). If so, install it and run xset fp rehash; if it won't work, maybe you have to restart xfs (the font server, if you installed it) and the X-Server, too.Originally posted by arrow014
Ok I added the first path and changed the directory name to just "ctp2" and now I'm getting:
If it still doesn't find the fonts, locate times.ttf and copy the ttf fonts to the directory, where you start ctp2 from.
For the .rim files, they are located in an .zfs Archive, maybe it's not installed within the ctp2_data path or isn't located within the search path mentioned in your userprofile. Sorry, if i can't tell more atm, i have no copy of ctp2 on this box.![]()

I've just commited those changes. This update should have the following effects:
- Game now doesn't always segfault on exit.
- All the font paths that were supposed to be searched really are searched.
- Some keyboard support in place (only keyboard-based scrolling, so far, but I think that was the hardest part - I've discovered that the way keyboard events are handled is really bizarre, so I had to do quite a lot of work to get this much working, but it should be downhill from here).

For the UC088 problem:
You should have a file /ctp2_data/default/graphics/cursors/UC088.tga that was in the repository. If you do, then for some reason it's not being found (Don't worry about the fact that the message was about a .rim, not a .tga - it should search for the .tga first and then the .rim). Check your userprofile.txt and get back to us.
If you don't have that file, then do an "svn status" and see what's happened to it. If it was somehow deleted then you can get it back with "svn revert".
On an unrelated note: Since I'm in the middle of fixing the keyboard support, you may see some of my debugging messages if you press any keys in the game. Don't worry about that.

Some more work on keyboard support done. Now all keys that are bound to game actions like settling or opening the city manager should work, although you still can't type into a text box, or move around in a list box.
For the moment the code assumes a British keyboard, because I needed to assume something, and a British keyboard was in front of me. I'm not sure how to make it properly support other keyboards, but it should be OK for most purposes - there will only be slight problems when the shift variants don't match up (e.g. pressing shift+2 will yield a double quote ("), whereas IIRC on an American keyboard it should be an at (@)).

Sorry for the long period of inactivity--I've been lazy (ie. too busy playing with Fluxbox, Nethack and a certain obscenely-titled console IRC client). Anyway, I found a copy of times.ttf and arial.ttf that quieted those messages. I do indeed have UC088.tga in /usr/src/ctp2/ctp2_data/default/graphics/cursors/, which should be ok since the line in userprofile.txt is:
After getting the fonts, I now get the opening CTP2 progress bar and everything looks cool for a second, then it quits with:Code:RuleSets=../../ctp2_data/;../../../../../mnt/shared/Games/ctp2/ctp2_data/
So it seems I now have a plethora of new, weird errors, and I see that UC088 thing is still complaining.../ctp2 nointromovie
No such device: No such device
Messagebox(Targa Load Error): Unable to find the file 'UC088.rim'
Messagebox(CRA_civilisation.txt line 114: Error): Could not find GREEK_DIPLOMAT_PHOTO in string database
Messagebox(¸8·civilisation.txt line 114: Error): Expected number of Civilisations not found
Messagebox(CivApp Error): Unable to Init the Databases.
Fatal error. Aborting.
At exit.
PeepEvents failed:
PeepEvents failed:
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
Segmentation fault
And what is that "no such device" thing about? I have the CD in: before that I was getting a "medium not found" error. What "device" is it trying to access now?
NOTE: I haven't done an SVN checkout or anything since the initial one 'cause I was afraid of having to redo much of the build process and the resulting errors. Now I'm realizing that I'm probably a version or two behind you guys and that might be causing problems (besides, doing the build again shouldn't be TOO hard, right...?). What should I do?
Treatment tomorrow...wish me luck!
-- Michael

Hmm... I'm not sure what could be going on there, then.Originally posted by arrow014
Sorry for the long period of inactivity--I've been lazy (ie. too busy playing with Fluxbox, Nethack and a certain obscenely-titled console IRC client). Anyway, I found a copy of times.ttf and arial.ttf that quieted those messages. I do indeed have UC088.tga in /usr/src/ctp2/ctp2_data/default/graphics/cursors/, which should be ok since the line in userprofile.txt is:
Code:RuleSets=../../ctp2_data/;../../../../../mnt/shared/Games/ctp2/ctp2_data/
The fact that it's reading CRA_civilisation.txt suggests that you have Cradle set to be used (in ModSwapper/ModManager) on your wndows installation of CTP2. Check that, and if you do, then deactivate it - I'm not sure how backwards compatible we are with mods at the moment, and it would be safest to stick with the default game until that's working properly.After getting the fonts, I now get the opening CTP2 progress bar and everything looks cool for a second, then it quits with:
../ctp2 nointromovie
No such device: No such device
Messagebox(Targa Load Error): Unable to find the file 'UC088.rim'
Messagebox(CRA_civilisation.txt line 114: Error): Could not find GREEK_DIPLOMAT_PHOTO in string database
Messagebox(¸8·civilisation.txt line 114: Error): Expected number of Civilisations not found
Messagebox(CivApp Error): Unable to Init the Databases.
Fatal error. Aborting.
At exit.
PeepEvents failed:
PeepEvents failed:
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
Segmentation fault
If un-selecting Cradle doesn't fix the UC088.rim problem then we'll have to dig a little deeper. If you're familiar with gdb, then I can tell you roughly what to do to find out what's happening. If not, then I can perhaps add some debugging output to the code so that we can find out exactly where it's looking for that file.
I'm not sure. In my output I get a "Operation not permitted: Operation not permitted" message. I don't know where either of these messages is coming from. Possibly somewhere in the SDL code for playing music off the CD. My message causes no problems, so hopefully yours doesn't either.So it seems I now have a plethora of new, weird errors, and I see that UC088 thing is still complaining.
And what is that "no such device" thing about? I have the CD in: before that I was getting a "medium not found" error. What "device" is it trying to access now?
I suggest you do an "svn up" and rebuild. It shouldn't cause any problems, and it should be considerably faster than it was the first timeNOTE: I haven't done an SVN checkout or anything since the initial one 'cause I was afraid of having to redo much of the build process and the resulting errors. Now I'm realizing that I'm probably a version or two behind you guys and that might be causing problems (besides, doing the build again shouldn't be TOO hard, right...?). What should I do?.
Good luck!Treatment tomorrow...wish me luck!![]()
![]()

Ooooohhh, whoops. Hadn't thought of that. Actually I have several installs of CTP2 on that drive (w/ various mod combinations), so I guess I need to find the right one and rename some directories so that userprofile.txt is pointing to the right one. Thanks!The fact that it's reading CRA_civilisation.txt suggests that you have Cradle set to be used (in ModSwapper/ModManager) on your wndows installation of CTP2.
I'm vaguely familiar with it...I used it to debug a simple assembler program one time. But I sure would like to learn more. Actually...this whole CTP2-on-Linux project has become more of a learning exercise for me; I realized the other day that I'm not actually all that interested in actually PLAYING the game any more...I just want to get it to compile and work properly and learn all I can in the process.If un-selecting Cradle doesn't fix the UC088.rim problem then we'll have to dig a little deeper. If you're familiar with gdb, then I can tell you roughly what to do to find out what's happening.\And then perhaps lend a hand if there's any relatively simple coding or documentation to be done...
Sweet. I'll hope that's the case, then...I'm not sure. In my output I get a "Operation not permitted: Operation not permitted" message. I don't know where either of these messages is coming from. Possibly somewhere in the SDL code for playing music off the CD. My message causes no problems, so hopefully yours doesn't either.
Ok...so what's the exact command for that? I tried to figure it out but I'm not quite sure of the syntax:I suggest you do an "svn up" and rebuild. It shouldn't cause any problems, and it should be considerably faster than it was the first time.
Or was the repo moved?Code:$ svn up svn://ctp2.kaan.dk/ctp2/branches/linux ctp2 svn: 'svn://ctp2.kaan.dk/ctp2/branches' is not a working copy
Thanks! The actual chemo injection went pretty uneventfully today and I'm feeling alright at the moment. The nightmare begins tomorrow (or possibly tonight)...Good luck!![]()
Be back in a week or so...

OK, well, here's how you can do it if it proves necessary, or if you just want to play around in gdb to see how things work:Originally posted by arrow014
I'm vaguely familiar with it...I used it to debug a simple assembler program one time. But I sure would like to learn more.
To start gdb just use "gdb ../ctp2" in the same directory you were running it from before (Be aware that it has to load pretty much all of the 250MB executable into memory, so if you have less than ~300MB of RAM, then it will start swapping frantically, and become quite slow - it can take a couple of minutes to load in this case. Even if you do have lots of RAM, it will still not be very fast). You can start ctp2 from inside gdb with the "run" command, and you can pass command line arguments to ctp2 through it. I suggest you use "run nointromovie".
The function that searches the asset tree for files (and that prints out the error you saw when it fails to find the file) is CivPaths::FindFile, defined in ctp2_code/gs/fileio/CivPaths.cpp. If you examine it you'll see that it searches first the current scenario path (whiuld be nothing in your case), then the current scenario pack path (again, should be nothing), then the paths defined in userprofile.txt, and then the default "../../ctp2_data" type paths.
Once gdb is loaded, but before starting ctp2, I suggest that you set a breakpoint at the start of the CivPaths::FindFile function (Simply use the command "break CivPaths::FindFile" - you can even tab-complete the class and function names). Now when you run ctp2 it should quickly reach your breakpoint and stop execution. step through execution for a while to get a feel for how the function works. When you want to stop stepping and let the program have free reign again, use "continue".
When gdb breaks ctp2, you'll notice that it conviniently tells you the values of the command line arguments. In particular, it should say something likethe first time it breaks. Note that it lists the filename there. Because this function gets called a lot, you'll want to put a condition of the breakpoint to only break when the filename passed is "UC088.tga". What you want to say is:Code:CivPaths::FindFile (this=0x8bf6da0, dir=C3DIR_DIRECT, filename=0x871f3d2 "userprofile.txt", path=0xbf807974 "", silent=0, check_prjfile=1)
(where 1 is the number of the breakpoint you just created - see "help condition" in gdb for more details on how this works) but that won't work, because you can't call strcmp in this context (I'm not sure whether that's a limitation of gdb, or simply because no one includedCode:condition 1 0==strcmp(filename,"UC088.tga")in this file). To do the whole check you'd have to write the condition as:
and so on. Fortunately, if you just check characters 0, 3 and 4, that should suffice.Code:filename[0]=='U' && filename[1]='C' && ...
Then it will break while searching for the appropriate file, and you can follow the execution to see exactly where it's looking, and thus find out where it's going wrong.
I've just gone through this whole process in order to explain it to you, and in doing so, I've discovered what the problem is. I should have realised before - it's looking for UC088.TGA, but the file is called UC088.tga, and Unix filesystems are case-sensitive. It so happens that I also have a UC088.tga on my NTFS partition where it's looking next, and, for me, it finds that one. The function must be changed so that it searches case-insensitively. In the short term, if you just want to get it working, you can rename the file.
I know the feeling. I knew few of these things I'm telling you before I set out on this project, but finding them out has been funActually...this whole CTP2-on-Linux project has become more of a learning exercise for me; I realized the other day that I'm not actually all that interested in actually PLAYING the game any more...I just want to get it to compile and work properly and learn all I can in the process.And then perhaps lend a hand if there's any relatively simple coding or documentation to be done...
.
If you're at the root of your working copy, then you can simply execute "svn up", and it will work. If not, then you need to supply the path to the root of your working copy. The reason you're getting that error is because it wants you to pass the path of a working copy, not the url of a repository. svn remembers which repository the working copy was associated with, so you don't have to keep telling it every time.Ok...so what's the exact command for that? I tried to figure it out but I'm not quite sure of the syntax:
Or was the repo moved?Code:$ svn up svn://ctp2.kaan.dk/ctp2/branches/linux ctp2 svn: 'svn://ctp2.kaan.dk/ctp2/branches' is not a working copy
I hope it goes as well as it can.Thanks! The actual chemo injection went pretty uneventfully today and I'm feeling alright at the moment. The nightmare begins tomorrow (or possibly tonight)...![]()
See you then.Be back in a week or so...
Last edited by J Bytheway; December 8, 2005 at 10:58.

Ugh. *sigh* So I did "svn up", "./autogen.sh", "./configure" and "make" and all that and now it's complaining about those stupid headers again:
I got this before (see previous posts) and fixed it by unpacking those two ZIP files, but this time it still gives me that error after I've unpacked them...the files are definitely there:../../tca/tca.c:33:34: error: 3rdparty/d3des/d3des.h: No such file or directory
../../tca/tca.c:34:49: error: 3rdparty/md5/global.h: No such file or directory
../../tca/tca.c:35:30: error: 3rdparty/md5/md5.h: No such file or directory
I get the feeling I just moved several steps BACKWARDS...[/usr/src/ctp2/ctp2_code] ls libs/anet/src/3rdparty/d3des/
d3des.c d3des.h readme unpacked
[/usr/src/ctp2/ctp2_code] ls libs/anet/src/3rdparty/md5
global.h md5.1 md5.1.txt md5c.c mddriver.c rfc1321.txt
Makefile md5.1.ps md5-announcement.txt md5.h README unpacked![]()
Bookmarks