Jump to content
XCOMUFO & Xenocide

Compilation problems


DaiShiva

Recommended Posts

  • Replies 113
  • Created
  • Last Reply

Top Posters In This Topic

Subversion stores some additional information in the working copy that help it to track changes and optimize network bandwidth on further updates and commits. As far as I know, it is impossible to convert the sources just downloaded from a webpage to a working copy. By the way, CVS works in the same way. So initial checkout is required. That's not a big problem as the size of data and sources stored in ufo2000 repository is relatively small (something like 1 or 2 megabytes).

If you tried to checkout Xenocide sources before and you are now afaid of very long download times, ufo2000 does not have this problem :)
Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
I installed all the stuff, checked out the latest version, got it to compile and run.
Now I have some questions concerning the code, some suggestions, etc.
Should we talk about it here ?
The developer-mailinglist looks like it doesn't have much discussions...

-HaJo
Link to comment
Share on other sites

[quote name='HaJo' date='Sep 4 2004, 12:53 PM']I installed all the stuff, checked out the latest version, got it to compile and run.[/quote]
Great. If you had any difficulties, or some steps are poorly discribed, share your impressions here.
So we can fix build instructions (or build process) and people trying to compile ufo2000 will have less problems in the future.

[quote]Now I have some questions concerning the code, some suggestions, etc.
Should we talk about it here ? [/quote]
OK, we can use this thread to discuss coding style, process of submitting patches, IDE, editors, compilers and build tools. But it is better to create separate threads for suggestions about improving the game itself.

[quote]The developer-mailinglist looks like it doesn't have much discussions...[/quote]
Right, but we can always start a discussion there too :)
Link to comment
Share on other sites

[quote name='Serge' date='Mar 7 2004, 11:28 AM']instructions how to build win32 binaries of the game and make installer.
First you need a set of tools.
..
run from a command line:
'svn co [url="http://lxnt.info:8888/repos/ufo2k/trunk"]http://lxnt.info:8888/repos/ufo2k/trunk[/url] c:\projects\ufo2000'[/quote]

If you have a router and/or firewall, you must enable port 8888,
maybe resticting this to the ip-address of lxnt.info

After installation of svn, mingw and msys, some customization might be required, e.g. edit
autoexec.bat ( SET APR_ICONV_PATH= ),
/etc/fstab ( /mingw )
/etc/profile ( alias )

[quote]After that everything is simple. Just run 'make' from ufo2000 sources directory[/quote]

Should add:
start MSYS to get a command-window, cd to ufo-directory, then make.

After you have a new .exe-file, where do you test it?
I copy them over to my play-directory.

And how do you test the ufo2000-server ?
(Err, how do *I* test a modified server-exe ?)


-HaJo Edited by HaJo
Link to comment
Share on other sites

[quote name='Serge' date='Sep 4 2004, 12:49 PM']OK, we can use this thread to discuss coding style, process of submitting patches, IDE, editors, compilers and build tools.[/quote]

I also installed the Dev-cpp, but I'm still not sure how to integrate it with ufo2000.

A brief look into some of the source-files got me some questions:[list]
[*] naming: PCK / SPK / MCD - looks like Picture/Sprite/Graphics-Handling,
but I have no idea what the names mean, and how it works


[*] I miss a 1-2 line comment after © telling what the file is good for


[*] Code-cleanup: there are lots of xcom1_color() with numeric constants.
Would you like to put them into a colors.h ?
I might be tempted to do this while reading thru the source...
[/list][quote]But it is better to create separate threads for suggestions about improving the game itself.[/quote]
Until I have a fair understanding of the code, I will stick to some simple user-interface issues -
like too little feedback in some places, so new players are left alone or confused
(Ctrl-Click on soldier comes to mind) ...

-HaJo
Link to comment
Share on other sites

[quote name='HaJo' date='Sep 4 2004, 02:33 PM']After you have a new .exe-file, where do you test it?
I copy them over to my play-directory.[/quote]
You can just copy x-com data files to XCOM subdirectory in your working copy. So you will be able to just run compiled executable.

[quote]And how do you test the ufo2000-server ?
(Err, how do *I* test a modified server-exe ?)[/quote]
Just start it. After that, run at least two instances of ufo2000 on the same computer (or on different computers if you have LAN), enter your computer IP address in connect server dialog instead of lxnt.info

[quote]I also installed the Dev-cpp, but I'm still not sure how to integrate it with ufo2000.[/quote]
I never tried it either. By the way, would anyone want to work with ufo2000 sources in Microsoft Visual Studio IDE? The game compiles fine by MSVC (though maybe some minor tweaks can be required, as I checked it a few months ago). It is not the first time, I'm asking this question, but nobody really cared about MSVC support before :)

[quote]A brief look into some of the source-files got me some questions:[list]

[*] naming: PCK / SPK / MCD - looks like Picture/Sprite/Graphics-Handling,
but I have no idea what the names mean, and how it works[/quote]
A pair of PCK and TAB files is just a container of small images 32x48 as far as I know. They are used as a storage for unit and terrain tiles. MCD file is a large array of map cell information records. Each map cell consists of 4 elements: 2 walls, floor and object. So basically MAP files are map blocks used to construct a map, each cell in MAP file is described by 4 bytes, each being an index in MCD array. MCD record has indexes of images in PCK files for constructing map on the screen along with other information. There are lots of resources about PCK, MCD and other x-com data formats around. Check Daishiva's home page for example.

[quote][*] I miss a 1-2 line comment after ©  telling what the file is good for[/quote]
A good point, the sources are never documented well enough, though I'm trying to comment some places when doing refactoring. I will try to start adding comments to the files too.

We are using [url="http://www.stack.nl/~dimitri/doxygen/"]doxygen[/url] to document ufo2000 sources. It requires to make comments a special format understandable by doxygen, so it can build something like this: [url="http://ufo2000.lxnt.info/files/ufo2000.chm"]http://ufo2000.lxnt.info/files/ufo2000.chm[/url]

Documenting the sources is something like chicken/egg problem. We don't need much detailed documentation for the code we have written ourselves, it is already clear to us, in addition nobody else is working with the sources, so this seems to be waste of time. On the other hand, it is unlikely for someone to join the developments team unless the sources are well documented. :)

We are adding comments to the code with each new release, so the situation is constantly improving.

If you find some code that is not clear and badly needs commenting, just ask.

[quote][*] Code-cleanup: there are lots of xcom1_color() with numeric constants.
Would you like to put them into a colors.h ?
I might be tempted to do this while reading thru the source...[/quote]

Do you mean something like this (from server_gui.cpp):
#define COLOR_GREEN xcom1_color(50)
#define COLOR_GRAY xcom1_color(3)
#define COLOR_RED xcom1_color(32)
Link to comment
Share on other sites

[quote][*] Code-cleanup: there are lots of xcom1_color() with numeric constants.
Would you like to put them into a colors.h ?[/quote]
[quote name='Serge' date='Sep 5 2004, 12:00 PM']Do you mean something like this (from server_gui.cpp):
#define COLOR_GREEN    xcom1_color(50)
#define COLOR_GRAY  xcom1_color(3)
#define COLOR_RED      xcom1_color(32)[/quote]

yes - that is one of the few places with named instead of numeric constants.
Link to comment
Share on other sites

I installed Doxygen, and tried to generate with the win-frontend
using doxy-en.conf, but after "Generating docs for file bullet.cpp...",
I get errormessages 'File "dot" not found'

And since "svn up" to 448, I get errors like
>>
In file included from src/bullet.cpp:21:
src/global.h:43:21: warning: allegro.h: No such file or directory
src/global.h:45:22: warning: winalleg.h: No such file or directory
<<

I made a fresh checkout, but now I get
make: *** No rule to make target `src/about.h', needed by `obj-win32/main.o'. Stop.I

I think I go back to 447 for now...

-HaJo
Link to comment
Share on other sites

[quote name='HaJo' date='Sep 6 2004, 10:01 AM'][quote][*] Code-cleanup: there are lots of xcom1_color() with numeric constants.
Would you like to put them into a colors.h ?[/quote]
[quote name='Serge' date='Sep 5 2004, 12:00 PM']Do you mean something like this (from server_gui.cpp):
#define COLOR_GREEN    xcom1_color(50)
#define COLOR_GRAY  xcom1_color(3)
#define COLOR_RED      xcom1_color(32)[/quote]
yes - that is one of the few places with named instead of numeric constants.
[/quote]
No objections :)
But in fact there are many different gradations of red color for example, so while these constants can be used in some places to improve code readability, replacing all the color indexes from x-com palette does not make much sence.

If you are looking for tasks to do, first you can look at our bugtracker and choose any of the bugs or feature requests that do not seem too difficult. I'm changing your access level to 'developer' in the bugtracker.

Also quite simple but useful task is a new "about" menu option for the game (old one did not work correctly for different color depth, so it was disabled long time ago and was finally removed in revision 448). It would be nice to have some visual effect in this "about" screen and just show some text in a loop :)

By the way, you probably have found out it yourself, but we are using [url="http://alleg.sf.net"]allegro[/url] library for 2D graphics, sound, keyboard/mouse handling and all other things. Allegro [url="http://alleg.sourceforge.net/api.html"]chm help file[/url] is very useful when working with ufo2000 sources.

[quote name='HaJo' date='Sep 6 2004, 06:24 PM']I installed Doxygen, and tried to generate with the win-frontend
using doxy-en.conf, but after "Generating docs for file bullet.cpp...",
I get errormessages  'File "dot" not found'[/quote]
[b]dot[/b] is a helper tool that is used by [b]doxygen[/b] to create nice looking inheritance and collaboration graphs. It can be disabled in doxygen conf file or downloaded from the following page: [url="http://www.research.att.com/sw/tools/graphviz/"]http://www.research.att.com/sw/tools/graphviz/[/url]
Also if you want to make chm file, you will also need html help compiler. But html docs can be built even without it.

By the way, this is some kind of offtopic, but "dot" is a rather useful tool that can be used even without doxygen. It processes graph description in text format and produces nice looking pictures. I have used it to make talents dependency graph for [url="http://www.adom.de"]ADOM[/url] roguelike game. Awk script processes information from game manual and makes .dot file which is used to get final png-picture. Everything can be downloaded [url="http://ufo2000.lxnt.info/adom/talents.zip"]here[/url]. The same trick can be used to create x-com technology tree picture for example :)

[quote]And since "svn up" to 448, I get errors like
>>
In file included from src/bullet.cpp:21:
src/global.h:43:21: warning: allegro.h: No such file or directory
src/global.h:45:22: warning: winalleg.h: No such file or directory
<<[/quote]
Looks like it can't find allegro header files, check if you have correct mingw-libs directory.

[quote]I made a fresh checkout, but now I get
make: *** No rule to make target `src/about.h', needed by `obj-win32/main.o'.  Stop.I

I think I go back to 447 for now...[/quote]
Try deleting all the object files (make clean). Revision 448 builds perfectly fine for me.
Link to comment
Share on other sites

[quote name='HaJo' date='Sep 6 2004, 10:01 AM'][*] Code-cleanup: there are lots of xcom1_color() with numeric constants.
Would you like to put them into a colors.h ?[/quote]
[quote name='Serge' date='Sep 5 2004, 12:00 PM']Do you mean something like this (from server_gui.cpp):
#define COLOR_GREEN    xcom1_color(50)
No objections :)

If you are looking for tasks to do, first you can look at our bugtracker[/quote]
Yes, but to find any bug, I first need to understand the code better.
So, the idea was to do something slightly useful while reading,
and not breaking anything...

[quote name='HaJo' date='Sep 6 2004, 06:24 PM']I installed Doxygen, and tried to generate with the win-frontend
using doxy-en.conf, but after "Generating docs for file bullet.cpp...",
I get errormessages  'File "dot" not found'[/quote]

[quote name='Serge'][b]dot[/b] is a helper tool that is used by [b]doxygen[/b] to create nice looking inheritance and collaboration graphs.[/quote]

[quote]"dot" .. processes graph description in text format and produces nice looking pictures. I have used it to make talents dependency graph for [url="http://www.adom.de"]ADOM[/url] roguelike game.[/quote]
Nice - I also played ADOM some time back, but did not get far :-)


[quote]And since "svn up" to 448, I get errors like
>>
In file included from src/bullet.cpp:21:
src/global.h:43:21: warning: allegro.h: No such file or directory
src/global.h:45:22: warning: winalleg.h: No such file or directory
<<[/quote]

[quote]Looks like it can't find allegro header files, check if you have correct mingw-libs directory.[/quote]
I already had everything working, I could build the previous version,
with server and installer,
and right after that svn up to 448, and I get errors,
*that* got me wondering....

Ok, I have to investigate


-HaJo
Link to comment
Share on other sites

  • 2 weeks later...
linux hackers rejoice for commander has the latest ( possibly not super great ) beta compiled and ready !

needs work . so , bump me to developer and we'll see what happens.


install slackware 9.1
install extra libraries
** install allegro config files ***
make clean
make

then fix the allegro.cfg i put it in /etc

will not fly properly under X ??? its a allegro thing fer sure.
under X ,,, i set it to run in console mode ... that seems best at this time.
Link to comment
Share on other sites

  • 6 months later...
Hi, im trying to get the latest sources...im at the point you (serge) said to put c:\projects, but im lost as far as the next step goes...please help :Help:
If there is anything i should know about these downloads?
They are not old are they?

PS: Is there any music players that play .s3m/.xm files up for downloading??
I like music while I work... Edited by *Nite*
Link to comment
Share on other sites

[quote name='*Nite*' date='Apr 5 2005, 01:29 AM']Hi, im trying to get the latest sources...im at the point you (serge) said to put c:\projects, but im lost as far as the next step goes...please help  :Help:
If there is anything i should know about these downloads?
They are not old are they?[/quote]
Some of the tools we are using have newer versions released but all the instructions are still up to date. What exactly does not work?
Link to comment
Share on other sites

what i like to do is make new units...could i get some help on how units were put together in ufo2000. I looked at all the units .pck files, but i don't see any sectoids, mutons, power suits, or flying suits...i don't get how they were implemented, well actually i think i have an idea, but im not so sure.

Let's say i want to be a possible developer...how do all of you make updated files for new beta versions? Edited by *Nite*
Link to comment
Share on other sites

Is anybody making new units yet? There is a request on snakeman demo... are you guys making that? Well anyway, im doing some tweaking with the muton.pck file in the ufo2000/xcom/units directory. I only placed a single image of the top of an ethereal facing northeast. There was a problem when i tried this: "Assert failed on scr/pck.cpp at line 232". Is it possible to add ethereals by editing the pck.cpp file? The file of the pck.cpp file is at the bottom of this post as a .txt file to get a better picture of line 232. The way i understand this is line 232 is about size and xcom color...im thinking it's the color not the size because i pretty much made the ethereal have only the upper body...isn't ethereals suppose to be xcom color? Can the code be changed to fix this problem, or does the whole tactical engine need redone? I heard that the tactical engine needs to be redone to add new units that aren't like the muton and sectoid...is it because that the pck file is being read through sequence order? You know, muton0 is read first, then muton1, etc...
I know i have asked a lot of questions, but it would be nice if they were all answered because i have been having these questions unanswered too long trying to figure out by myself. Please developers, help me out... :Help:

By the way...i figured that out how to get the source code now...i know that a lot of people are desperate, like me, of getting new units...some people are not even playing because of few units... Edited by *Nite*
Link to comment
Share on other sites

[quote name='*Nite*' date='Apr 15 2005, 08:18 PM']Is anybody making new units yet?[/quote]
Yes, gassa is making them. That's not the first time this question is asked in this forum :)

[quote]There is a request on snakeman demo... are you guys making that? Well anyway, im doing some tweaking with the muton.pck file in the ufo2000/xcom/units directory. I only placed a single image of the top of an ethereal facing northeast. There was a problem when i tried this: "Assert failed on scr/pck.cpp at line 232". Is it possible to add ethereals by editing the pck.cpp file? The file of the pck.cpp file is at the bottom of this post as a .txt file to get a better picture of line 232. The way i understand this is line 232 is about size and xcom color...im thinking it's the color not the size because i pretty much made the ethereal have only the upper body...isn't ethereals suppose to be xcom color? Can the code be changed to fix this problem, or does the whole tactical engine need redone? I heard that the tactical engine needs to be redone to add new units that aren't like the muton and sectoid...is it because that the pck file is being read through sequence order? You know, muton0 is read first, then muton1, etc...
I know i have asked a lot of questions, but it would be nice if they were all answered because i have been having these questions unanswered too long trying to figure out by myself. Please developers, help me out... :Help:[/quote]
PCK files are just containers for the sets of sprites, you don't need to mess up with this code to add new skins. The problem is that ethereal pck is different from muton pck, they have different number of frames and need different code for combining these frames to get complete sprites. What is needed to be improved is Skin::draw function (in skin.cpp).

[quote]By the way...i figured that out how to get the source code now...i know that a lot of people are desperate, like me, of getting new units...some people are not even playing because of few units...
[right][post="117262"]<{POST_SNAPBACK}>[/post][/right][/quote]
That's good. Did you manage to compile source code already?
Link to comment
Share on other sites

[quote name='Jezulkim' date='Apr 16 2005, 01:43 PM']I looked at some files in newunits folder (nazi.pck, green.pck, soldier.pck)
They included some soldier sprites, why they aren't included in game?
[right][post="117333"]<{POST_SNAPBACK}>[/post][/right][/quote]
Two reasons:
1. They are obvoiusly edited x-com sprites and that's why not quite legally clean, probably they will be removed from the distributive in one of the next versions of ufo2000 (but you will be able to use them in third-party addons :) )
2. We need to add some code for skins installation and management (similar to maps and now weapons addons installation)
Link to comment
Share on other sites

[quote]That's good. Did you manage to compile source code already?[/quote]

Well, when i try to compile on visual c++, it says this:

[quote]c:\msys\1.0\home\none\ufo2000\src\jpgalleg\jpgalleg.h(23) : fatal error C1083: Cannot open include file: 'allegro.h': No such file or directory
Error executing cl.exe.[/quote]

i think im missing some libraries...do i need to comile it under some other compiler?
Link to comment
Share on other sites

[quote name='*Nite*' date='Apr 16 2005, 07:17 PM']Well, when i try to compile on visual c++, it says this:

[quote]c:\msys\1.0\home\none\ufo2000\src\jpgalleg\jpgalleg.h(23) : fatal error C1083: Cannot open include file: 'allegro.h': No such file or directory
Error executing cl.exe.[/quote]
i think im missing some libraries...do i need to comile it under some other compiler?
[right][post="117345"]<{POST_SNAPBACK}>[/post][/right]
[/quote]
Well, I think you are missing reading instructions :)

The game should be compiled using [b]mingw c++[/b] compiler. Also you need to download and extract [b]mingw-libs.zip[/b] archive into ufo2000 sources directory (it contains all the needed libraries including allegro).

The game can be compiled using visual c++ but that will require getting and compiling all the libraries the game depends on (allegro, hawknl, sqlite, zlib, libpng, ogg vorbis, freetype), making msvc project file or tweaking makefile, also some fixes to the sources may or may not be required (it was long ago when I tried to compile the game using visual c++). So I would recommend you to compile the game stright as the instructions describe and start making some other experiments a bit later :)
Link to comment
Share on other sites

ok, my current directory for the trunk files are in:
c:\msys\1.0\home\none\trunk (im using the name trunk instead of ufo2000 right now)

well i went to msys, typed in: cd c:/msys/1.0/home/none/ufo2000 and that set the directory so thats good...then i typed "make" and it says:
[quote]g++ -MMD -funsigned-char -Wall -Wno-deprecated-declarations -I src/lua -DDEBUGMO DE -DUFO_SVNVERSION=\"802\" -02 -pipe
-DHAVE_FREETYPE
-DGLYPH_TARGET=GLYPH+TARGET_ALLEGRO -DGK_NO_LEGACY
-DHAVE_DUMBOGG -DHAVE_PNG -DWIN32 -DALLEGRO_STATICLINK
-I mingw-libs/include -L mingw-libs/lib -c src/bullet.cpp -o obj-win32/bullet.o
make: g++: Command not found
make: *** [obj-win32/bullet.o] Error 127[/quote]

I have windows 98 second edition...is this a problem?
I put the mingw libraries into: c:/msys/1.0/home/none/trunk...i put the nsys plug-ins into: c:/msys/1.0/home/none/trunk like you said...I have all the files installed you told me too...except the "makensis206_log".
Where do i put makensis206_log?

Im sorry to ask you questions that to you are easy, serge...
Link to comment
Share on other sites

That g++ is a c++ compiler from mingw. If the system can't find it, my guess would be that you either did not install it or it is not correctly registered in PATH (bin subdirectory from mingw installation).

To check that mingw is installed correctly you can try to run 'gcc --version', it will show some information about its version.

BTW, do you ICQ? Such issues are resolved much faster when communicating using IM.
Link to comment
Share on other sites

[quote name='jammers' date='Apr 22 2005, 08:05 PM']Ive just about got it to compile on my ibook, would anyone else like instructions? its a bit tricky
[right][post="117904"]<{POST_SNAPBACK}>[/post][/right][/quote]
Was it something like this: [url="http://www.lxnt.info/pipermail/ufo2000/2005-February/002230.html"]http://www.lxnt.info/pipermail/ufo2000/200...ary/002230.html[/url] ?
Anyway, having compilation instructions for all platforms is a good idea.
Link to comment
Share on other sites

[quote name='Serge' date='Apr 22 2005, 02:16 PM'][quote name='jammers' date='Apr 22 2005, 08:05 PM']Ive just about got it to compile on my ibook, would anyone else like instructions? its a bit tricky
[right][post="117904"]<{POST_SNAPBACK}>[/post][/right][/quote]
Was it something like this: [url="http://www.lxnt.info/pipermail/ufo2000/2005-February/002230.html"]http://www.lxnt.info/pipermail/ufo2000/200...ary/002230.html[/url] ?
Anyway, having compilation instructions for all platforms is a good idea.
[right][post="117913"]<{POST_SNAPBACK}>[/post][/right]
[/quote]

Yeah pritty much (exept i forgot freetype :s)
Exept i was going to make it a lot more clearer for the average mac user.
Link to comment
Share on other sites

  • 2 months later...
Is it alright for just anyone to mess around with beta code? I mean without claiming it is theres. Because I have a few ideas--and I keep getting more.

1) Lisp based AI. [url="http://www.xcomufo.com/forums/index.php?showtopic=7697"]http://www.xcomufo.com/forums/index.php?showtopic=7697[/url]

2) A better chat client--the current one sucks

3) Fix the draw command... though I haven't seen it though--but I have a few ideas there.

I am sure I will come up with more ^_^
Link to comment
Share on other sites

[quote name='DakeDesu' date='Jun 28 2005, 04:51 AM']Is it alright for just anyone to mess around with beta code? I mean without claiming it is theres. Because I have a few ideas--and I keep getting more.[/quote]

Just check these links:
[url="http://lxnt.info:8888/repos/ufo2k/trunk/gnu.txt"]http://lxnt.info:8888/repos/ufo2k/trunk/gpl.txt[/url] (shown when installing the game by the way)
[url="http://lxnt.info:8888/repos/ufo2k/trunk/AUTHORS"]http://lxnt.info:8888/repos/ufo2k/trunk/AUTHORS[/url]
[url="http://lxnt.info:8888/repos/ufo2k/trunk/HACKING"]http://lxnt.info:8888/repos/ufo2k/trunk/HACKING[/url]

[b]Edit:[/b] also check this thread if you want to discuss this issue: [url="http://www.xcomufo.com/forums/index.php?showtopic=7852"]http://www.xcomufo.com/forums/index.php?showtopic=7852[/url] Edited by Serge
Link to comment
Share on other sites

  • 2 weeks later...
Hi all,

Just got the code to compile as per the instructions except for some trouble compiling exchndl.c, namely an undefined function (bfd_get_section_size_before_reloc).

Is this a new issue with the latest beta code or is everyone else just not bothering to compile exchndl.c? Its use seems fairly mystifying - something about executable formats and trying to extract debug symbols?

So now I wondering if the changes I've made to exchndl.c to get it to link are going to cause me problems?

Cheers,
Zorg
Link to comment
Share on other sites

  • 2 weeks later...
[quote name='Zorg' date='Jul 9 2005, 07:42 PM']Hi all,

Just got the code to compile as per the instructions except for some trouble compiling exchndl.c, namely an undefined function (bfd_get_section_size_before_reloc).

Is this a new issue with the latest beta code or is everyone else just not bothering to compile exchndl.c? Its use seems fairly mystifying - something about executable formats and trying to extract debug symbols?

So now I wondering if the changes I've made to exchndl.c to get it to link are going to cause me problems?

Cheers,
Zorg
[right][post="124597"]<{POST_SNAPBACK}>[/post][/right][/quote]


I just downloaded the 886 source and have the same problem compiling exchndl.c , (bfd_get_section_size_before_reloc) and also (In function `PEGetSymFromAddr':
src/exchndl/exchndl.c:233: error: subscripted value is neither array nor pointer). Compiling with Mingw32 as per instructions ... exchndl.c is 13 months old so I guess this is not erroneous code but some fault on my part - any ideas anyone?

Btw Zorg: if you've done a workaround for this problem - even if it's temporary - I'd be very interested in seeing it - I haven't had any luck so far ;<

/ futsu
Link to comment
Share on other sites

The use for this code is a stack backtrace reporting on crashes, see [url="http://ufo2000.lxnt.info/results.php"]http://ufo2000.lxnt.info/results.php[/url] and [url="http://ufo2000.lxnt.info/results-beta.php"]http://ufo2000.lxnt.info/results-beta.php[/url]

Maybe you are using a new mingw version? I have installed mine very long ago and do not have any problems with it :)

In any case, exchndl.c can be easily removed from the sources tree so that the game still works (linux version does not use it at all).
Link to comment
Share on other sites

[quote name='futsukayoi' date='Jul 20 2005, 06:28 AM']I just downloaded the 886 source and have the same problem compiling exchndl.c , (bfd_get_section_size_before_reloc) and also (In function `PEGetSymFromAddr':
src/exchndl/exchndl.c:233: error: subscripted value is neither array nor pointer). Compiling with Mingw32 as per instructions ... exchndl.c is 13 months old so I guess this is not erroneous code but some fault on my part - any ideas anyone?

Btw Zorg: if you've done a workaround for this problem - even if it's temporary - I'd be very interested in seeing it - I haven't had any luck so far ;<

/ futsu
[right][post="125774"]<{POST_SNAPBACK}>[/post][/right][/quote]

futsu,

Sorry I didn't reply sooner, assuming you didn't just pull the source files the fix goes something like...

src/exchndl/exchndl.c

To fix the error your getting you need to fix the array indexing, something has obviously happened and the compiler doesn't like it anymore.

At around line 231-234 you need something like
if(!ReadProcessMemory(hProcess, (PVOID) ( (DWORD)hModule + (DWORD) (&ExportDir.AddressOfNames)[j] ), &dwNearestName, sizeof(dwNearestName), NULL))

(&ExportDir.AddressOfNames)[j] ) Is the actual change to make it work.

Although it looks like this may have been pulled in the latest version of the code (mine is now 2 or 3 weeks old).

Once you get past that, you may need these bad boys

#define bfd_get_section_size_before_reloc(section) (section->reloc_done ? (abort(),1): (section)->rawsize)
#define bfd_get_section_size_after_reloc(section) ((section->reloc_done) ? (section)->size: (abort(),1))

If needs be I can post a full diff but as I say it looks like the source has been updated since I checked it out.

Hope that helps...

Peace,
Zorg
Link to comment
Share on other sites

  • 2 weeks later...
Bumping this thread again, but probably some people want IDE support? Which one is would you like to have support for: Dev-C++, Microsoft Visual Studio, Eclipse, ...?

PS. Dev-C++ support is already working via scons. If anybody cares, I can provide some insructions.
Link to comment
Share on other sites

  • 1 month later...
[quote name='Zorg' date='Jul 9 2005, 07:42 PM']Just got the code to compile as per the instructions except for some trouble compiling exchndl.c, namely an undefined function (bfd_get_section_size_before_reloc).

Is this a new issue with the latest beta code or is everyone else just not bothering to compile exchndl.c? Its use seems fairly mystifying - something about executable formats and trying to extract debug symbols?

So now I wondering if the changes I've made to exchndl.c to get it to link are going to cause me problems?[/quote]
If anybody still tracks this topic, the problems compiling the game with the latest stable version of mingw are now resolved (in revision 951).
Link to comment
Share on other sites

[quote name='Serge' date='Aug 9 2005, 05:26 AM']Bumping this thread again, but probably some people want IDE support? Which one is would you like to have support for: Dev-C++, Microsoft Visual Studio, Eclipse, ...?

PS. Dev-C++ support is already working via scons. If anybody cares, I can provide some insructions.
[right][post="127987"]<{POST_SNAPBACK}>[/post][/right][/quote]
Ms Visual Studio would be great... Just 'cause you're asking.. :)
Link to comment
Share on other sites

  • 2 weeks later...
[quote name='Mad' date='Oct 8 2005, 08:03 PM']Ms Visual Studio would be great... Just 'cause you're asking.. :)[/quote]
Do you really want to try compiling ufo2000 using MS Visual Studio or it is just a 'nice to have' suggestion? ;) We don't have much free time, but if MSVC support is really needed (can help us to get more developers), it will be added.

Using gcc for compiling both windows and linux versions is a good idea in order just to have less chances of breaking linux support when programming and testing in windows and vice versa. The game was compiled by MSVC some time ago, but it was dropped in favour of Mingw.
Link to comment
Share on other sites

[quote name='Serge' date='Oct 17 2005, 07:16 PM']Do you really want to try compiling ufo2000 using MS Visual Studio or it is just a 'nice to have' suggestion? ;) We don't have much free time, but if MSVC support is really needed (can help us to get more developers), it will be added.
[right][post="137604"]<{POST_SNAPBACK}>[/post][/right][/quote]
I really would like to compile it using MS Visual Studio, but I don't think I have enough time and/or code knowledge to contribute to the project. PJ Xenocide is more or less eating up all the free time I have. So you shouldn't implement it just for me, on the other hand I think since PJ Xenocide is using Visual Studio as the main IDE, it could really help you to get more developers and minimizes the borders between the two projects - although it might not be needed, but who knows... :)
Link to comment
Share on other sites

[quote name='Mad' date='Oct 17 2005, 08:41 PM']... on the other hand I think since PJ Xenocide is using Visual Studio as the main IDE, it could really help you to get more developers and minimizes the borders between the two projects - although it might not be needed, but who knows... :)[/quote]
Actually different licenses is the main border between our two projects now. Is it good or bad, don't know, but we have to live with that. On the other hand, geoscape development for ufo2000 can get a boost now :) There is no use waiting for xenocide geoscape now, as we will not be able to use it anyway.

About MSVC support, I think it is not difficult at all to compile the game using it. It took me an evening to do this about half a year ago (build all the library dependencies and fix some minor compilation problems). What is difficult is to always maintain that MSVC project in a working state, it could just start draining our already scarce resources. But any skilled C++ developer can make this MSVC project for ufo2000 himself, so it's not a stopping factor that could prevent new developers from joining us :) And I can always provide some advice or help in the case of any problems.
Link to comment
Share on other sites

[quote name='Serge' date='Oct 20 2005, 08:17 PM'][quote name='Mad' date='Oct 17 2005, 08:41 PM']... on the other hand I think since PJ Xenocide is using Visual Studio as the main IDE, it could really help you to get more developers and minimizes the borders between the two projects - although it might not be needed, but who knows... :)[/quote]
Actually different licenses is the main border between our two projects now. Is it good or bad, don't know, but we have to live with that. On the other hand, geoscape development for ufo2000 can get a boost now :) There is no use waiting for xenocide geoscape now, as we will not be able to use it anyway.
[right][post="137873"]<{POST_SNAPBACK}>[/post][/right]
[/quote]
That sucks :(
Link to comment
Share on other sites

  • 1 month later...
[quote name='Kratos' date='May 15 2005, 10:11 AM']I have enough c++ experience to read what is what functions and I can write a little bit of code. My knowledge in tweaking is good also. Do you developers think I have enough experience to write code for this game? Stupid question, but I want to know if I am ready to even start coding.
[right][post="119623"]<{POST_SNAPBACK}>[/post][/right][/quote]

IMHO if you think you can do it, try... submit the patch then they'll tell you if you are up to this.

And... for I have spent all late afternoon doing this... getting started from scratch with the tools is a good test in itself.

I'll sure have a try at the sources but I think I'll make some mistakes before giving a reliable patch.
Link to comment
Share on other sites

  • 4 months later...
Hi Guys,

I have some problems while trying to compile the code, so i hope someone can help me with this :)

I downloaded all the linked files in the compilation thread. The only problem is that the link to the extra libraries (allegro/ expat) is dead, so I have tried downloading allegro seperately but that gave me a whole truckload of new errors and the source started asking for all kinds of random other packages...at which point i figured it's probably a better idea to ask for the packages here tongue.gif

I did try to compile the code (even though i know i dont have allegro etc) and I immediately get a different error which someone else asked about in this thread as well:

QUOTE
mkdir obj-win32
g++ -MMD -funsigned-char -Wall -Wno-deprecated-declarations -I src/lua -I src/lu asqlite3 -DDEBUGMODE -DUFO_SVNVERSION=\"1011\" -O2 -pipe -DHAVE_FREETYPE -DGLYPH _TARGET=GLYPH_TARGET_ALLEGRO -DGK_NO_LEGACY -DHAVE_DUMBOGG -DHAVE_PNG -DWIN32 -D ALLEGRO_STATICLINK -I mingw-libs/include -L mingw-libs/lib -c src/bullet.cpp -o obj-win32/bullet.o
make: g++: Command not found
make: *** [obj-win32/bullet.o] Error 127


now in your answer in the compile thread you mention setting the PATH...but i tried looking in the dir and i couldn't find anything resembling that. Can you please explain how i can fix this?

The reason I want to get the source up and running is because i'm currently studying for my master's degree in Artificial Intelligence. For one particular class me and a couple of other students have to write an AI for a game we can pick ourselves.
Since we have all been a huge fan of the XCOM series of games we jumped at the idea when we found out there was actually an open source version available!!

So once we get the source to compile and run (we all use windows) we can get to work because we only have a couple of weeks to get the job done. As you might have guessed our combined linux knowledge is rather pathetic ^_^ so if anyone can help us getting the code to compile that would be awesome!

hope to hear from you soon,

Jainy


p.s. Our combined knowledge of C++ and programming in general is expert, since me and another student have already got a degree in software engineering and i actually have been working as software engineer for 3+ years :cheers:
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...