Never mind.  After a bit more trial and error I hit upon the correct modifications.  Thanks.

On 8/3/05, James Cliburn < [EMAIL PROTECTED]> wrote:
Hi, I'm encountering a compile error in FlightGear.  I think the solution is known, but not yet implemented.

My configuration:
AMD Athlon64 3000+
Abit AV8 motherboard, VIA K8T800 chipset
1 GB RAM
Nvidia GeForce FX5200, NVIDIA-Linux-x86_64-1.0-7667 driver (Xorg works fine)
Fedora Core 4, kernel 2.6.12-1.1398_FC4
gcc (GCC) 4.0.1 20050727 (Red Hat 4.0.1-5)

SimGear builds and installs without error.

FlightGear encounters the following compile error:

if g++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src  -I/usr/X11R6/include -I/usr/local//include  -g -O2 -D_REENTRANT -MT AIBase.o -MD -MP -MF ".deps/AIBase.Tpo" -c -o AIBase.o AIBase.cxx; \
then mv -f ".deps/AIBase.Tpo" ".deps/AIBase.Po"; else rm -f ".deps/AIBase.Tpo"; exit 1; fi
AIBase.cxx: In member function 'int FGAIBase::_getID() const':
AIBase.cxx:389: error: cast from 'const FGAIBase*' to 'int' loses precision
make[2]: *** [AIBase.o] Error 1
make[2]: Leaving directory `/opt/src/FlightGear-0.9.8/src/AIModel'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/src/FlightGear-0.9.8/src'
make: *** [all-recursive] Error 1

Here are the particulars on relevant installed libs/utils.

[EMAIL PROTECTED] FlightGear-0.9.8]# yum list freeglut* plib* zlib* metakit*
Setting up repositories
livna                     100% |=========================|  903 B    00:00
updates-released          100% |=========================|  951 B    00:00
base                      100% |=========================| 1.1 kB    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
Installed Packages
freeglut.i386                            2.2.0-16               installed
freeglut.x86_64                          2.2.0-16               installed
freeglut-devel.x86_64                    2.2.0-16               installed
metakit.x86_64                           2.4.9.3-8              installed
metakit-devel.x86_64                     2.4.9.3-8              installed
plib-devel.x86_64                        1.8.4-1.fc4            installed
zlib.i386                                1.2.2.2-5.fc4          installed
zlib.x86_64                              1.2.2.2-5.fc4          installed
zlib-devel.x86_64                        1.2.2.2-5.fc4          installed
zlib-devel.i386                          1.2.2.2-5.fc4          installed
Available Packages
plib16-devel.x86_64                      1.6.0-3                extras
zlib-debuginfo.x86_64                    1.2.2.2-5.fc4          updates-released


I found the following in the list archives, but it's not quite enough detail to get me past the problem.  (I'm using gcc 4.) Would someone mind providing explicit details on which source lines in which files need to be changed, and to what?  Thanks so much.

Andy Ross andy at plausible.org
Wed Jun 29 09:04:11 CDT 2005 Previous message: [Flightgear-users] Fedora Core 4 x86-64 and FlightGear
Pete Buelow wrote:
> I'm trying to build FlightGear for FC4 on an nifty new amd64 game
> machine. I used to fly on a slightly slower Athlon, but want to
> step up to the plate and see if things are that much better with

> my new video card and 64 bit processor. Here's the issue.
>
> [... a spot where a pointer is cast to an int ...]

Yes, gcc 4.0 will not allow you to directly cast a pointer to an

integer on systems where their sizes differ, due to the
information loss problem (which is real in this case, as the
value is used as an "ID"). I think I posted this a while back,
but maybe I just remember thinking about doing it.


On my build, I just hacked the casts (I think there are two,
actually) to be of the form:

(int)(long)pointerValue

This "double cast" construction compiles and works. At least on
my system, you can verify using pmap that there is no heap memory

mapped to addresses that are equal "modulo 2^32", so there is no
possibility of collision. It really isn't an appropriate
permanent solution, though. The ID values should be guaranteed
to be unique on all platforms.


Andy



_______________________________________________
Flightgear-users mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-users
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to