Compiling under Linux, Bag of fun! |
Compiling under Linux, Bag of fun! |
iprice |
Jul 20 2005, 02:52 PM
Post
#1
|
||||||
Newbie Group: Members Posts: 4 Joined: 9-June 05 Member No.: 572 |
Hi, Noticed a bit of discussion about the Linux compilation was in the other thread but thought it might be better to break this out.... I'm fairly dedicated to geting this thing (re)built under linux, and heres my story so far... A couple of months ago I setup a 'training comm etc' server on my home Linux box, 12 bots and a few player slots for commander / etc. Compiling RCBot was rather difficult, I was using "gcc version 3.3 20030226 (prerelease) (SuSE Linux)" as the compiler and had to make various modifications to the sources to get it to compile. Please note while I am a programmer I am *not* a C++ programmer (never liked the language, but something I always felt I needed overcome perhaps one day). One of the things I hate about the C strain is the error messages from most compilers are horrendous. Anyway lets not get into the old programming language holy wars, just wanted to point out I have very little idea specifically what i'm doing, but a sound backgound in programming and Unix and so forth. I found the 'linux binaries' supplied would just crash randomly, particularly on bot add's as detailed in various forums, which is what got me working on the source. I made the following changes to the rcbot source distribution to get it to compile under linux and run successfully - the only issue apart from the AI being a bit poor in places (like skulks at your bot's feet dont get seen usually , rines obsessed with rushing and knifing OCs etc) was the max_paths_revs falling to 0 after a while, which isn't too bad and something i'd schedule a cronjob/rcon to fix quite easily. *) The addition of "-I ." to the makefile parameters to include the current directory in the include search *) The addition of the "-fpermissive" flag to the makefile to ignore errors regarding ISO C++ standards violation, variables declared with no type (?) etc *) Then things got wierd, I get errors like
... Which I *bodged* around by changing "abs" into "fabs" *) There was some error compiling the HAL module, where it tries to select something from a list... I forget the exact error, I just made the code do nothing since I didn't want HAL functionality anyway. And shockingly for someone who doesn't know what they're doing, this worked and the bots did run around and die lots (their ranking on psychostats is horrible ). Anyway, it lagged lots because it was running on a busy server, and the internet pipe to that server sucks for upstream anyway, so I recently got a new box and was working on moving it over to there... The compiler is now: gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) Reason I am now writing is I am again stuck on various syntactic C issues, and I don't have the knowledge to resolve these. With the above fixes (except the HAL one which the makefile hasn't tried to compile yet) in place, I now get the following error:
Now somehow I worked out this is related to the 'vector' type, and line 49 of generic_class.h reads "#include <vector>" which if i change it to "#include <vector.h>" changes the error to a similar one in a different place
followed by tons more 'undeclared' errors for variable 'it' and 'array', followed by similar barfage from other source files. The source i'm using is listed as "RCBot Source, Latest source for latest beta" on the downloads page. What i'm looking for is a bit of help with the C++ language and some interpretation of the errore messages, and I would like to try and work on getting this source compiled on linux, ideally the same source should compile on win and linux, but even if it comes down to a separate 'inferior/out of date' package for linux it would be a start! My only other option I can think of trying is to downgrade the new C++ compiler back to the previous version and try compiling on the new machine again... Needless to say this is a horrible option I'd really rather not go down. Thanks for your time, and any help you can offer. Iain |
||||||
billcat |
Feb 24 2006, 02:00 AM
Post
#2
|
Member Group: Members Posts: 24 Joined: 6-October 03 Member No.: 65 |
made a little headway.
commented out everything related to bugmessage. (shouldn't this be DEbugmessage as it is all over in the rest of the code?) now I get the following: root@suitcase:/raid/transfer/rcbot/dlls# make -fmakefile_linux_sa g++ -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -mcpu=i486 -O2 -w -I. -I../engine -I../common -I../pm_shared -fpermissive -c bot.cpp -o bot.o g++ -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -mcpu=i486 -O2 -w -I. -I../engine -I../common -I../pm_shared -fpermissive -c bot_client.cpp -o bot_client.o generic_class.h: In member function `void dataUnconstArray<T>::RemoveByPointer(T*) [with T = TSObjective]': bot_client.cpp:409: instantiated from here generic_class.h:976: error: no matching function for call to ` std::vector<TSObjective, std::allocator<TSObjective> >::erase(TSObjective*&) ' /usr/local/include/c++/3.3.6/bits/vector.tcc:105: error: candidates are: __gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >) [with _Tp = TSObjective, _Alloc = std::allocator<TSObjective>] /usr/local/include/c++/3.3.6/bits/vector.tcc:117: error: __gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >, __gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >) [with _Tp = TSObjective, _Alloc = std::allocator<TSObjective>] make: *** [bot_client.o] Error 1 |
Lo-Fi Version | Time is now: 28th March 2024 - 05:42 PM |