[Flightgear-devel] Re: Undefined Symbols

2003-02-18 Thread David Drum
[FlightGear-Devel readers: this is another installment in my quest
to get FlightGear compiled under Mac OS X.  I now have a good lead on
the final link failure, I think.  If you have any knowledge of linker
naming conventions, symbol tables, and the like, I would appreciate
your comments.  Thanks.  P.S. Everything is being built from CVS.]

Previous make's were failing, unable to find gen_leaf or
ssgVtxTable::ssgVtxTable.

Sometime recently the call to gen_leaf was removed from the CVS code.
Instead, three other symbols are now not being found.  Here's the final
make command along with output:

david@Cynosure ~/FlightGear/src/main
$ make
g++ -DPKGLIBDIR=\"/Users/david/lib/FlightGear\" -g -O2 -D_REENTRANT  
-L/Users/david/lib -L/usr/X11R6/lib -o fgfs  main.o fg_commands.o fg_init.o fg_io.o 
fg_props.o fgfs.o globals.o logger.o options.o splash.o util.o viewer.o viewmgr.o 
location.o ../../src/Aircraft/libAircraft.a ../../src/ATC/libATC.a 
../../src/Autopilot/libAutopilot.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/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/GUI/libGUI.a ../../src/Input/libInput.a 
../../src/Instrumentation/libInstrumentation.a ../../src/Model/libModel.a 
../../src/Navaids/libNavaids.a ../../src/Scenery/libScenery.a 
../../src/Scripting/libScripting.a ../../src/Sound/libSound.a 
../../src/Airports/libAirports.a ../../src/Network/libNetwork.a 
../../src/NetworkOLK/libNetworkOLK.a ../../src/Objects/libObjects.a 
../../src/Systems/libSystems.a ../../src/Time/libTime.a 
../../src/Environment/libEnvironment.a -lsgroute -lsgsky -lsgephem -lsgtiming -lsgio 
-lsgscreen -lsgmath -lsgbucket -lsgdebug -lsgmagvar -lsgmisc -lsgxml -lsgserial 
-lsgthreads -lplibpu -lplibfnt -lplibjs -lplibnet -lplibssg -lplibsg -lplibul 
-lplibpsl -lmk4 -lz -lpthread -lm  -framework GLUT -framework OpenGL -framework Carbon 
-lobjc -lplibsl -lplibsm -framework IOKit -framework CoreFoundation -lm 
ld: warning table of contents of library: ../../src/FDM/JSBSim/libJSBSim.a not sorted 
slower link editing will result (use the ranlib(1) -s option)
ld: Undefined symbols:
trTileSize(_TRctx*, long, long, long)
trImageSize(_TRctx*, long, long)
trTileBuffer(_TRctx*, unsigned long, unsigned long, void*)
ssgVtxTable::ssgVtxTable[in-charge](unsigned, ssgVertexArray*, ssgNormalArray*, 
ssgTexCoordArray*, ssgColourArray*)
make: *** [fgfs] Error 1

I have been using nm to poke around and believe I know what is going on,
even if I don't know how to fix it:

david@Cynosure ~
$ nm -o lib/libsgscreen.a FlightGear/src/GUI/gui_funcs.o | egrep 
'trTileSize|trImageSize|trTileBuffer'
lib/libsgscreen.a:tr.o:1564 S _Z10trTileSizeP6_TRctxiii.eh
lib/libsgscreen.a:tr.o:158c S _Z11trImageSizeP6_TRctxii.eh
lib/libsgscreen.a:tr.o:01d4 T __Z10trTileSizeP6_TRctxiii
FlightGear/src/GUI/gui_funcs.o: U __Z10trTileSizeP6_TRctxlll
lib/libsgscreen.a:tr.o:03c8 T __Z11trImageSizeP6_TRctxii
FlightGear/src/GUI/gui_funcs.o: U __Z11trImageSizeP6_TRctxll
lib/libsgscreen.a:tr.o:036c T __Z12trTileBufferP6_TRctxjjPv
FlightGear/src/GUI/gui_funcs.o: U __Z12trTileBufferP6_TRctxmmPv

If you look closely at the "T" lines and the "U" lines, you will see that
the symbol names do not match!  No wonder the final link fails.  I guess
I need some way to get the compiler to generate the same symbol names.

The other unfound symbol, ssgVtxTable::ssgVtxTable[in-charge] is trickier,
but I found it.  The sad thing is, the symbol names match, so I don't
know why the symbol is not found.

david@Cynosure ~
$ nm `find plib -type f -name \*.o -print` | egrep ssgVtxTable | egrep 
'^.[TU]' | sort +0.11 | uniq > foo
david@Cynosure ~
$ nm `find FlightGear -type f -name \*.o -print` | egrep ssgVtxTable | egrep 
'^.[TU]' | sort +0.11 | uniq > bar
david@Cynosure ~
$ cat bar
 U 
__ZN11ssgVtxTableC1EmP14ssgVertexArrayP14ssgNormalArrayP16ssgTexCoordArrayP14ssgColourArray
david@Cynosure ~
$ egrep 
__ZN11ssgVtxTableC1EmP14ssgVertexArrayP14ssgNormalArrayP16ssgTexCoordArrayP14ssgColourArray
 foo
 U 
__ZN11ssgVtxTableC1EmP14ssgVertexArrayP14ssgNormalArrayP16ssgTexCoordArrayP14ssgColourArray
050c T 
__ZN11ssgVtxTableC1EmP14ssgVertexArrayP14ssgNormalArrayP16ssgTexCoordArrayP14ssgColourArray

Regards,

David K. Drum
[EMAIL PROTECTED]

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



[Flightgear-devel] Re: Undefined Symbols

2003-02-18 Thread David Drum
Quoth David Drum:

> I have been using nm to poke around and believe I know what is going on,
> even if I don't know how to fix it:
> 
> david@Cynosure ~
> $ nm -o lib/libsgscreen.a FlightGear/src/GUI/gui_funcs.o | egrep 
>'trTileSize|trImageSize|trTileBuffer'
> lib/libsgscreen.a:tr.o:1564 S _Z10trTileSizeP6_TRctxiii.eh
> lib/libsgscreen.a:tr.o:158c S _Z11trImageSizeP6_TRctxii.eh
> lib/libsgscreen.a:tr.o:01d4 T __Z10trTileSizeP6_TRctxiii
> FlightGear/src/GUI/gui_funcs.o: U __Z10trTileSizeP6_TRctxlll
> lib/libsgscreen.a:tr.o:03c8 T __Z11trImageSizeP6_TRctxii
> FlightGear/src/GUI/gui_funcs.o: U __Z11trImageSizeP6_TRctxll
> lib/libsgscreen.a:tr.o:036c T __Z12trTileBufferP6_TRctxjjPv
> FlightGear/src/GUI/gui_funcs.o: U __Z12trTileBufferP6_TRctxmmPv
> 
> If you look closely at the "T" lines and the "U" lines, you will see that
> the symbol names do not match!  No wonder the final link fails.  I guess
> I need some way to get the compiler to generate the same symbol names.

I have just solved this problem using the brute-force method:

# get rid of the current object file
david@Cynosure ~/FlightGear/src/GUI
$ rm gui_funcs.o

# remake the object file
david@Cynosure ~/FlightGear/src/GUI
$ make
source='gui_funcs.cxx' object='gui_funcs.o' libtool=no \
depfile='.deps/gui_funcs.Po' tmpdepfile='.deps/gui_funcs.TPo' \
depmode=gcc3 /bin/sh ../../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src  
-I/Users/david/include -I/usr/X11R6/include  -g -O2 -D_REENTRANT -c -o gui_funcs.o 
`test -f 'gui_funcs.cxx' || echo './'`gui_funcs.cxx
rm -f libGUI.a
ar cru libGUI.a new_gui.o dialog.o menubar.o gui.o gui_funcs.o gui_local.o mouse.o 
net_dlg.o preset_dlg.o prop_picker.o sgVec3Slider.o trackball.o 
ranlib libGUI.a

# verify that the wrong symbol names are still being generated
david@Cynosure ~/FlightGear/src/GUI
$ egrep -l 
'__Z10trTileSizeP6_TRctxlll|__Z11trImageSizeP6_TRctxll|__Z12trTileBufferP6_TRctxmmPv' 
gui_funcs.o
gui_funcs.o

# change to correct symbol names
david@Cynosure ~/FlightGear/src/GUI
$ perl -p -i -e 
's+__Z10trTileSizeP6_TRctxlll+__Z10trTileSizeP6_TRctxiii+g;s+__Z11trImageSizeP6_TRctxll+__Z11trImageSizeP6_TRctxii+g;s+__Z12trTileBufferP6_TRctxmmPv+__Z12trTileBufferP6_TRctxjjPv+g;'
 gui_funcs.o

# remake
david@Cynosure ~/FlightGear/src/GUI
$ rm libGUI.a
david@Cynosure ~/FlightGear/src/GUI
$ make
rm -f libGUI.a
ar cru libGUI.a new_gui.o dialog.o menubar.o gui.o gui_funcs.o gui_local.o mouse.o 
net_dlg.o preset_dlg.o prop_picker.o sgVec3Slider.o trackball.o 
ranlib libGUI.a

# see if the final link likes the new library
david@Cynosure ~/FlightGear/src/GUI
$ cd ../Main
david@Cynosure ~/FlightGear/src/Main
$ make
g++ -DPKGLIBDIR=\"/Users/david/lib/FlightGear\" -g -O2 -D_REENTRANT  
-L/Users/david/lib -L/usr/X11R6/lib -o fgfs  main.o fg_commands.o fg_init.o fg_io.o 
fg_props.o fgfs.o globals.o logger.o options.o splash.o util.o viewer.o viewmgr.o 
location.o ../../src/Aircraft/libAircraft.a ../../src/ATC/libATC.a 
../../src/Autopilot/libAutopilot.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/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/GUI/libGUI.a ../../src/Input/libInput.a 
../../src/Instrumentation/libInstrumentation.a ../../src/Model/libModel.a 
../../src/Navaids/libNavaids.a ../../src/Scenery/libScenery.a 
../../src/Scripting/libScripting.a ../../src/Sound/libSound.a 
../../src/Airports/libAirports.a ../../src/Network/libNetwork.a 
../../src/NetworkOLK/libNetworkOLK.a ../../src/Objects/libObjects.a 
../../src/Systems/libSystems.a ../../src/Time/libTime.a 
../../src/Environment/libEnvironment.a -lsgroute -lsgsky -lsgephem -lsgtiming -lsgio 
-lsgscreen -lsgmath -lsgbucket -lsgdebug -lsgmagvar -lsgmisc -lsgxml -lsgserial 
-lsgthreads -lplibpu -lplibfnt -lplibjs -lplibnet -lplibssg -lplibsg -lplibul 
-lplibpsl -lmk4 -lz -lpthread -lm  -framework GLUT -framework OpenGL -framework Carbon 
-lobjc -lplibsl -lplibsm -framework IOKit -framework CoreFoundation -lm 
ld: warning table of contents of library: ../../src/FDM/JSBSim/libJSBSim.a not sorted 
slower link editing will result (use the ranlib(1) -s option)
ld: Undefined symbols:
ssgVtxTable::ssgVtxTable[in-charge](unsigned, ssgVertexArray*, ssgNormalArray*, 
ssgTexCoordArray*, ssgColourArray*)
make: *** [fgfs] Error 1

Woo-hoo!  An ugly method, but I'll take it.  Now for the last error...

Regards,

David K. Drum
[EMAIL PROTECTED]

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] Re: Undefined Symbols

2003-02-18 Thread Bernie Bright
On Tue, 18 Feb 2003 16:05:26 -0600
David Drum <[EMAIL PROTECTED]> wrote:

> [FlightGear-Devel readers: this is another installment in my quest
> to get FlightGear compiled under Mac OS X.  I now have a good lead on
> the final link failure, I think.  If you have any knowledge of linker
> naming conventions, symbol tables, and the like, I would appreciate
> your comments.  Thanks.  P.S. Everything is being built from CVS.]
> 
> Previous make's were failing, unable to find gen_leaf or
> ssgVtxTable::ssgVtxTable.
> 
> Sometime recently the call to gen_leaf was removed from the CVS code.
> Instead, three other symbols are now not being found.  Here's the final
> make command along with output:
> 
> david@Cynosure ~/FlightGear/src/main
> $ make
> g++ -DPKGLIBDIR=\"/Users/david/lib/FlightGear\" -g -O2 -D_REENTRANT 
> -L/Users/david/lib -L/usr/X11R6/lib -o fgfs  main.o fg_commands.o fg_init.o
> fg_io.o fg_props.o fgfs.o globals.o logger.o options.o splash.o util.o
> viewer.o viewmgr.o location.o ../../src/Aircraft/libAircraft.a
> ../../src/ATC/libATC.a ../../src/Autopilot/libAutopilot.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/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/GUI/libGUI.a ../../src/Input/libInput.a
> ../../src/Instrumentation/libInstrumentation.a ../../src/Model/libModel.a
> ../../src/Navaids/libNavaids.a ../../src/Scenery/libScenery.a
> ../../src/Scripting/libScripting.a ../../src/Sound/libSound.a
> ../../src/Airports/libAirports.a ../../src/Network/libNetwork.a
> ../../src/NetworkOLK/libNetworkOLK.a ../../src/Objects/libObjects.a
> ../../src/Systems/libSystems.a ../../src/Time/libTime.a
> ../../src/Environment/libEnvironment.a -lsgroute -lsgsky -lsgephem
> -lsgtiming -lsgio -lsgscreen -lsgmath -lsgbucket -lsgdebug -lsgmagvar
> -lsgmisc -lsgxml -lsgserial -lsgthreads -lplibpu -lplibfnt -lplibjs
> -lplibnet -lplibssg -lplibsg -lplibul -lplibpsl -lmk4 -lz -lpthread -lm 
> -framework GLUT -framework OpenGL -framework Carbon -lobjc -lplibsl -lplibsm
> -framework IOKit -framework CoreFoundation -lm ld: warning table of contents
> of library: ../../src/FDM/JSBSim/libJSBSim.a not sorted slower link editing
> will result (use the ranlib(1) -s option) ld: Undefined symbols:
> trTileSize(_TRctx*, long, long, long)
> trImageSize(_TRctx*, long, long)
> trTileBuffer(_TRctx*, unsigned long, unsigned long, void*)
> ssgVtxTable::ssgVtxTable[in-charge](unsigned, ssgVertexArray*,
> ssgNormalArray*, ssgTexCoordArray*, ssgColourArray*) make: *** [fgfs] Error
> 1
> 
> I have been using nm to poke around and believe I know what is going on,
> even if I don't know how to fix it:
> 
> david@Cynosure ~
> $ nm -o lib/libsgscreen.a FlightGear/src/GUI/gui_funcs.o | egrep
> 'trTileSize|trImageSize|trTileBuffer'
> lib/libsgscreen.a:tr.o:1564 S _Z10trTileSizeP6_TRctxiii.eh
> lib/libsgscreen.a:tr.o:158c S _Z11trImageSizeP6_TRctxii.eh
> lib/libsgscreen.a:tr.o:01d4 T __Z10trTileSizeP6_TRctxiii
> FlightGear/src/GUI/gui_funcs.o: U __Z10trTileSizeP6_TRctxlll
> lib/libsgscreen.a:tr.o:03c8 T __Z11trImageSizeP6_TRctxii
> FlightGear/src/GUI/gui_funcs.o: U __Z11trImageSizeP6_TRctxll
> lib/libsgscreen.a:tr.o:036c T __Z12trTileBufferP6_TRctxjjPv
> FlightGear/src/GUI/gui_funcs.o: U __Z12trTileBufferP6_TRctxmmPv
> 
> If you look closely at the "T" lines and the "U" lines, you will see that
> the symbol names do not match!  No wonder the final link fails.  I guess
> I need some way to get the compiler to generate the same symbol names.
> 

>From simgear/screen/tr.h:

extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint
border);

It looks like GLint is defined as an int when compiling SimGear but is long
when compiling FlightGear.

Bernie



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] Re: Undefined Symbols

2003-02-18 Thread David Drum
Quoth Bernie Bright:

> From simgear/screen/tr.h:
> 
> extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint border);
> 
> It looks like GLint is defined as an int when compiling SimGear but
> is long when compiling FlightGear.

Thank you for the interpretation.  The gui_funcs.cxx define of GLint is
coming from /System/Library/Frameworks/OpenGL.framework/Headers/gl.h
(the Mac OS X distribution of OpenGL).  The tr.cxx define of GLint is
coming from /usr/X11R6/include/GL/gl.h (the Mac OS X distribution of X11).
I'll have to mull this one over a bit.

Regards,

David K. Drum
[EMAIL PROTECTED]

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] Re: Undefined Symbols

2003-02-19 Thread Erik Hofman
Bernie Bright wrote:





From simgear/screen/tr.h:


extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint
border);

It looks like GLint is defined as an int when compiling SimGear but is long
when compiling FlightGear.


Ouch, what a horrible way to find thise kind of problems.
I guess this asks for a compiler problem report.

Erik


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel