I have made a bunch of progress, but have not yet gotten everything to work.
So I still have some questions.
I hope by posting this I can help others compile stuff, and also get some
help to finish up the compile.
Despite what the users guide says for building under OSX I have been using
gcc 3.3.
I am sorry for the length of this email, but I have included some diffs and
compile errors in detail.
Here are the steps that I have had to go through:
export BUILDDIR=/Users/dersh/Programming/fgdev
Download plib 1.8.3
Made the following changes to the files:
diff jsMacOSX.cxx jsMacOSX_org.cxx
17,19c17
< //int jsJoystick::kNumDevices = 32 ;
< int jsJoystick::kNumDevices = JS_MAX_OSX_DEVICES ;
<
---
> int jsJoystick::kNumDevices = 32 ;
21,22c19
< //io_object_t jsJoystick::ioDevices[kNumDevices];
< io_object_t jsJoystick::ioDevices[JS_MAX_OSX_DEVICES] ;
---
> io_object_t jsJoystick::ioDevices[kNumDevices];
132,133c129,130
< HRESULT pluginResult = (*plugin)->QueryInterface(plugin,
< CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), &hidDev);
---
> HRESULT pluginResult = (*plugin)->QueryInterface(plugin,
> CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID),
&(LPVOID)hidDev);
The last change above was because I kept getting a compile error:
jsMacOSX.cxx: In member function `void jsJoystick::open()':
jsMacOSX.cxx:133: error: non-lvalue in unary `&'
I don't like removing a cast without understanding the implications, but I
did it anyway, just get it to compile. So my first question is really a
plib question, but it is why there is the LPVOID, and is it OK to just
remove it?
diff js.h js_org.h
35,36d34
< #define JS_MAX_OSX_DEVICES 32
<
97c95
< static int kNumDevices;
---
> static const int kNumDevices;
99,100c97
< // static io_object_t ioDevices[kNumDevices];
< static io_object_t jsJoystick::ioDevices[JS_MAX_OSX_DEVICES] ;
---
> static io_object_t ioDevices[kNumDevices];
But then building plib works fine:
./autogen.sh
./configure -prefix=$BUILDDIR
make install
Next to build SimGear I kept getting stream related errors. I made the
following change to simgear/compiler.h and then I was able to get it to
build as well:
diff compiler.h "compiler org.h"
82c82
< #ifdef __GNUC__ || __APPLE__
---
> #ifdef __GNUC__
It seems that even though I am using gcc, the right flag is not being set,
so each of the test programs, that does require streams, and other standard
IO kinds of things gave link errors.
./autogen.sh
./configure -prefix=$BUILDDIR
make install
Finally, when I try to build FlightGear I can compile everything, but the
final like fails.
I have been doing:
/autogen.sh
./configure --prefix=$BUILDDIR --with-threads --without-x
make install
And here is the final link warnings and errors:
g++ -DPKGLIBDIR=\"/Users/dersh/Programming/fgdev/share/FlightGear\" -g -O2
-D_REENTRANT -L/Users/dersh/Programming/fgdev/lib -o fgfs bootstrap.o
../../src/Main/libMain.a ../../src/Aircraft/libAircraft.a
../../src/ATC/libATC.a ../../src/Cockpit/libCockpit.a
../../src/Cockpit/built_in/libBuilt_in.a ../../src/Controls/libControls.a
../../src/FDM/libFlight.a ../../src/FDM/Balloon/libBalloon.a
../../src/FDM/ExternalNet/libExternalNet.a
../../src/FDM/ExternalPipe/libExternalPipe.a
../../src/FDM/JSBSim/libJSBSim.a ../../src/FDM/YASim/libYASim.a
../../src/FDM/JSBSim/filtersjb/libfiltersjb.a
../../src/FDM/LaRCsim/libLaRCsim.a ../../src/FDM/UIUCModel/libUIUCModel.a
../../src/FDM/SP/libSPFDM.a ../../src/GUI/libGUI.a
../../src/Autopilot/libAutopilot.a ../../src/Input/libInput.a
../../src/Instrumentation/libInstrumentation.a ../../src/Model/libModel.a
../../src/AIModel/libAIModel.a ../../src/Network/libNetwork.a
../../src/Navaids/libNavaids.a ../../src/Scenery/libScenery.a
../../src/Scripting/libScripting.a ../../src/Sound/libSound.a
../../src/Airports/libAirports.a ../../src/MultiPlayer/libMultiPlayer.a
../../src/Replay/libReplay.a ../../src/Systems/libSystems.a
../../src/Time/libTime.a ../../src/Traffic/libTraffic.a
../../src/Environment/libEnvironment.a -lsgclouds3d -lsgroute -lsgsky
-lsgsound -lsgephem -lsgmaterial -lsgtgdb -lsgmodel -lsgtiming -lsgio
-lsgscreen -lsgmath -lsgbucket -lsgprops -lsgdebug -lsgmagvar -lsgmisc
-lsgnasal -lsgxml -lsgsound -lsgserial -lsgstructure -lsgenvironment
-lsgthreads -lpthread -lplibpu -lplibfnt -lplibjs -lplibnet -lplibssg
-lplibsg -lplibul -lz -framework GLUT -framework OpenGL -framework AGL
-framework Carbon -lobjc -framework IOKit -framework OpenAL
ld: warning multiple definitions of symbol _glutWireTorus
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireTorus in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireTorus
ld: warning multiple definitions of symbol _glutSolidDodecahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidDodecahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidDodecahedron
ld: warning multiple definitions of symbol _glutSolidOctahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidOctahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidOctahedron
ld: warning multiple definitions of symbol _glutSolidSphere
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidSphere in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidSphere
ld: warning multiple definitions of symbol _glutSolidCube
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidCube in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidCube
ld: warning multiple definitions of symbol _glutSolidCone
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidCone in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidCone
ld: warning multiple definitions of symbol _glutWireCube
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireCube in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireCube
ld: warning multiple definitions of symbol _glutWireCone
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireCone in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireCone
ld: warning multiple definitions of symbol _glutSolidTetrahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidTetrahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidTetrahedron
ld: warning multiple definitions of symbol _glutSolidTorus
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidTorus in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidTorus
ld: warning multiple definitions of symbol _glutSolidIcosahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutSolidIcosahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutSolidIcosahedron
ld: warning multiple definitions of symbol _glutWireTetrahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireTetrahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireTetrahedron
ld: warning multiple definitions of symbol _glutWireSphere
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireSphere in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireSphere
ld: warning multiple definitions of symbol _glutWireOctahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireOctahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireOctahedron
ld: warning multiple definitions of symbol _glutWireIcosahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireIcosahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireIcosahedron
ld: warning multiple definitions of symbol _glutWireDodecahedron
/Users/dersh/Programming/fgdev/lib/libsgclouds3d.a(glut_shapes.o) definition
of _glutWireDodecahedron in section (__TEXT,__text)
/System/Library/Frameworks/GLUT.framework/GLUT(single module) definition of
_glutWireDodecahedron
ld: Undefined symbols:
SGMagVar::update(double, double, double, double)
SGMagVar::SGMagVar()
CamMinMaxBoxOverlap(Camera const*, float const*, float const*)
Frustum16fv(float*, float, float, float, float, float, float)
Viewing16fv(float*, float const*, float const*, float const*, float const*)
Viewport16fv(float*, int, int)
invFrustum16fv(float*, float, float, float, float, float, float)
invViewing16fv(float*, float const*, float const*, float const*, float
const*)
invViewport16fv(float*, int, int)
Screen2WorldXform16fv(float*, float const*, float const*, float const*,
float const*, float, float, float, float, float, float, int, int)
World2ScreenXform16fv(float*, float const*, float const*, float const*,
float const*, float, float, float, float, float, float, int, int)
Viewing2CoordFrame16fv(float const*, float*, float*, float*, float*)
VFC(Camera const*, float const*, float const*)
make[2]: *** [fgfs] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
Where should those final symbols be coming from? Also, is it a problem that
there are a multiple defined glut things? Which one is the best of each of
these to use? Is there a way to make it use one or the other?
Finally, I noticed something else. I am not sure who the maintainer is.
But in JSBSim/Makefile.solo (not required for FG, but good for other
things.) there is a typo. That will not allow for a building of JSBSim
separately.
It reads:
JSBSim : $(JSBSim_objects) JSBSim.o libFCSComponents.a
$(CC) $(INCLUDES) $(CCOPTS) $(LINKDIR) $(JSBSim_objects) JSBSim.o
-oJSBSim -lm -lFCSComponents
But that will not work.
It should have a space after the -o. So it should be:
JSBSim : $(JSBSim_objects) JSBSim.o libFCSComponents.a
$(CC) $(INCLUDES) $(CCOPTS) $(LINKDIR) $(JSBSim_objects) JSBSim.o -o
JSBSim -lm -lFCSComponents
How can we get that fixed in the CVS version?
Thank you for any help.
-- Adam
> From: <[EMAIL PROTECTED]>
> Reply-To: FlightGear developers discussions <[EMAIL PROTECTED]>
> Date: Wed, 10 Nov 2004 13:15:45 -0500
> To: <[EMAIL PROTECTED]>
> Subject: [Flightgear-devel] Building FlightGear on Mac OSX
>
>
> On Nov 9th, 2004, Adam wrote:
>>
>> I have been trying to build FlightGear 0.96 (CVS) on a Mac, and have
>> been
>> using fgdev, and have followed the instructions in the FG users guide,
>> as
>> well as the instructions included in fgdev, but I have run into a
>> bunch of
>> problems.
>> Any help that anyone can offer would be greatly appreciated.
>> I have searched the lists and see that some others have had some of
>> the same
>> problems, but I have not found postings of solutions. I guess that the
>> instructions for building on a Mac in the users guide are somewhat out
>> of
>> date.
>>
>> I am using OSX 10.3.5 and I have Xcode 1.5 installed (gcc 3.3 and gcc
>> 2.95.2). The insructions say to use gcc 2.95, so I have started with
>> that.
>> I also am using tcsh as instructed (which is no longer the Mac
>> default).
>>
>> First I found that by default I already had the versions of automake
>> and
>> autoconf that the instructions say to build, so I did not do that.
>> (1.6.3
>> and 2.53 respectively)
>>
>> I had trouble getting plib to build, but, after a few changes, got it
>> to
>> compile.
>
> What problems did you have please? How did you fix them?
>
>>
>> The instructions next call for building metakit, but I assume that is
>> now
>> included in SimGear?
>>
>
> metakit is not needed anymore. it was replaced by something else, I'm
> afraid that I can't remember what 8-( I think it's built into simgear,
> however, and not external. Someone please correct me if I'm wrong...
>
>> Building SimGear failed with gcc 2.95. When I switched to 3.3 it got
>> much
>> further, but failed on testserial. I was hoping that this is not
>> critical.
>>
>> So next I tried to build FlightGear itself:
>> ./configure --prefix=$BUILDDIR --without-threads --without-x
>> configure: error: cannot run /bin/sh ./config.sub
>
> What is your BUILDDIR value set to? It should be the path to the fg
> build tree (mine is
> /flightgear/fgdev9.6)
>
> I will be happy to try to help, health permitting -- November is
> shaping up to be a bad month as it's turning colder -- but please give
> some more info regarding the exact errors that you're hitting. You may
> or may not have in fact gotten past them. If plib is not built right,
> then all bets are off as to whether you'll succesfully build the rest.
>
>
>> I found that the reason is that config.sub does not exist.
>
> I have config.sub in ./src/FlightGear, ./src/plib and ./src/SimGear
> I didn't check all of them but config.sub in src/FlightGear is a link
> to:
>
> lrwxrwxrwx 1 ima staff 34 19 Jun 2003 src/flightgear/config.sub ->
> /usr/share/automake-1.6/config.sub
>
> are you sure you've got automake installed right? This is NOT something
> that seems to be touched on every build... My src/FlightGear file has
> the following timestamp inside it:
>
> timestamp='2002-07-03'
>
> Shouldn't
>> autogen.sh create this file? Did I do something wrong?
>> (I see that someone else had the same problem and posted to the mailing
>> list, but I could not find a response).
>>
>>
>> So, where I think I stand is: I have plib, I think that I have
>> SimGear? I
>> have downloaded and installed OpenAL and I can't get FG itself to even
>> start
>> to compile.
>>
>> Thanks,
>>
>>
>> -- Adam
>>
>>
>>
> Here are my build scripts (I build from the command line, I think that
> others on the list have FG building from XCode but I haven't done this:
>
>> cat makeplib.sh makesg.sh makefg.sh
>> cd $BUILDDIR/src/plib
>> ./autogen.sh
>> ./configure --prefix=$BUILDDIR
>> make install
>>
>>
>> cd $BUILDDIR/src/SimGear
>> ./autogen.sh
>> ./configure --prefix=$BUILDDIR
>> make install
>>
>>
>> cd $BUILDDIR/src/FlightGear
>> ./autogen.sh
>> ./configure --prefix=$BUILDDIR --with-threads --without-x
>> make install
>> echo "'make install' done"
>
> My GCC version is:
>
> gcc --version
> gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
> Copyright (C) 2002 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is
> NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> I am using mac os x 10.3.6, but did build with 10.5 in the past.
>
> I last built plib, simgear and flightgear from CVS on 11/5/04 and had
> no problems.
>
> I am using automake 1.6.3 and autoconf 2.57
>
> Hope this helps.
>
> Welcome to the project, FlightGear is a great Mac OS X compatible
> flight sim. I haven't used X Plane in years even. 8-) This is a great
> list, with a lot of skilled and helpful people on it...
>
> Ima
>
> PS -- if you use .sh scripts with tcsh, you'll need to run child
> scripts via the 'source' command in order to properly pass the
> environment (including BUILDDIR to the child processes)
>
>
> _______________________________________________
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel
> 2f585eeea02e2c79d7b1d8c4963bae2d
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d