[Flightgear-devel] 0.9.9 compile problem
I'm attempting to compile FlightGear 0.9.9 on Linspire 5.0. Compiling simgear 0.9.9 went fine, but FlightGear fails with the following error: / g++ -DPKGLIBDIR=\"/usr/share/games/FlightGear\" -g -O2 -D_REENTRANT -L/usr/X11R6/lib -L/usr/lib -o metar metar_main.o -lsgenvironment -lsgio -lsgbucket -lsgmisc -lsgstructure -lsgdebug -lsgprops -lsgserial -lsgxml -lplibnet -lplibul -lz -ldl -lm -ljpeg /usr/lib/libsgenvironment.so: undefined reference to `ssgContext::loadModelviewMatrix(float (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `glRotatef' /usr/lib/libsgenvironment.so: undefined reference to `sgMakeRotMat4(float (*) [4], float, float const*)' /usr/lib/libsgenvironment.so: undefined reference to `sg_random' /usr/lib/libsgenvironment.so: undefined reference to `glVertex3f' /usr/lib/libsgenvironment.so: undefined reference to `calc_gc_lon_lat(Point3D const&, double, double)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::CloudVis' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundSample::set_source_pos(float*)' /usr/lib/libsgenvironment.so: undefined reference to `sgMakeCoordMat4(float (*) [4], float, float, float, float, float, float)' /usr/lib/libsgenvironment.so: undefined reference to `SGBbCache::startNewFrame()' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::get_CacheSize()' /usr/lib/libsgenvironment.so: undefined reference to `glDisable' /usr/lib/libsgenvironment.so: undefined reference to `glDepthMask' /usr/lib/libsgenvironment.so: undefined reference to `glBegin' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_CloudVis(float)' /usr/lib/libsgenvironment.so: undefined reference to `_ssgCurrentContext' /usr/lib/libsgenvironment.so: undefined reference to `glLineWidth' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_CacheSize(int)' /usr/lib/libsgenvironment.so: undefined reference to `glColor4fv' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_density(float)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_enable3dClouds(bool)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::density' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundMgr::is_playing(std::basic_string, std::allocator > const&)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::get_CacheResolution()' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundMgr::find(std::basic_string, std::allocator > const&)' /usr/lib/libsgenvironment.so: undefined reference to `glPopMatrix' /usr/lib/libsgenvironment.so: undefined reference to `SGNewCloud::cldCache' /usr/lib/libsgenvironment.so: undefined reference to `sgMakeTransMat4(float (*) [4], float const*)' /usr/lib/libsgenvironment.so: undefined reference to `sgSetCoord(sgCoord*, float const (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `ssgContext::getModelviewMatrix(float (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::enable3D' /usr/lib/libsgenvironment.so: undefined reference to `glPushMatrix' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_CacheResolution(int)' /usr/lib/libsgenvironment.so: undefined reference to `glBindTexture' /usr/lib/libsgenvironment.so: undefined reference to `glEnable' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundSample::play(bool)' /usr/lib/libsgenvironment.so: undefined reference to `calc_gc_course_dist(Point3D const&, Point3D const&, double*, double*)' /usr/lib/libsgenvironment.so: undefined reference to `glShadeModel' /usr/lib/libsgenvironment.so: undefined reference to `glTranslatef' /usr/lib/libsgenvironment.so: undefined reference to `glColor4f' /usr/lib/libsgenvironment.so: undefined reference to `glBlendFunc' /usr/lib/libsgenvironment.so: undefined reference to `sgPostMultMat4(float (*) [4], float const (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `glEnd' /usr/lib/libsgenvironment.so: undefined reference to `sgPreMultMat4(float (*) [4], float const (*) [4])' collect2: ld returned 1 exit status make: *** [metar] Error 1/ The first undefined reference is to /ssgContext::loadModelviewMatrix. /However, an /"nm -D/ //usr/lib/libsgenvironment.so |grep ssgContext" /reveals: U _ZN10ssgContext18getModelviewMatrixEPA4_f U _ZN10ssgContext19loadModelviewMatrixEPA4_f Any help would be appreciated. Thanks! -Brian ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.9 compile problem
Brian, What compiler are you using. This looks a bit strange. Most often, ifyou link against a library, it only pulls in the required routines from that library and ignores everything else. But in this case it almost looks like your linker is requiring all symbols in the libsgenvironment.a to get resolved, even if they are part of functions that aren't referenced or used. The sgi compilers have this tendency, but gcc is usually very smart about this. The quick fix would be to add the additional libs ... -lsgmath -lplibsg -lGL, etc. But it would be interesting to know which compiler you are using to see if it makes sense that it should squawk about this or not ... Regards, Curt. Brian Thomason wrote: I'm attempting to compile FlightGear 0.9.9 on Linspire 5.0. Compiling simgear 0.9.9 went fine, but FlightGear fails with the following error: / g++ -DPKGLIBDIR=\"/usr/share/games/FlightGear\" -g -O2 -D_REENTRANT -L/usr/X11R6/lib -L/usr/lib -o metar metar_main.o -lsgenvironment -lsgio -lsgbucket -lsgmisc -lsgstructure -lsgdebug -lsgprops -lsgserial -lsgxml -lplibnet -lplibul -lz -ldl -lm -ljpeg /usr/lib/libsgenvironment.so: undefined reference to `ssgContext::loadModelviewMatrix(float (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `glRotatef' /usr/lib/libsgenvironment.so: undefined reference to `sgMakeRotMat4(float (*) [4], float, float const*)' /usr/lib/libsgenvironment.so: undefined reference to `sg_random' /usr/lib/libsgenvironment.so: undefined reference to `glVertex3f' /usr/lib/libsgenvironment.so: undefined reference to `calc_gc_lon_lat(Point3D const&, double, double)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::CloudVis' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundSample::set_source_pos(float*)' /usr/lib/libsgenvironment.so: undefined reference to `sgMakeCoordMat4(float (*) [4], float, float, float, float, float, float)' /usr/lib/libsgenvironment.so: undefined reference to `SGBbCache::startNewFrame()' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::get_CacheSize()' /usr/lib/libsgenvironment.so: undefined reference to `glDisable' /usr/lib/libsgenvironment.so: undefined reference to `glDepthMask' /usr/lib/libsgenvironment.so: undefined reference to `glBegin' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_CloudVis(float)' /usr/lib/libsgenvironment.so: undefined reference to `_ssgCurrentContext' /usr/lib/libsgenvironment.so: undefined reference to `glLineWidth' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_CacheSize(int)' /usr/lib/libsgenvironment.so: undefined reference to `glColor4fv' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_density(float)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_enable3dClouds(bool)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::density' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundMgr::is_playing(std::basic_stringstd::char_traits, std::allocator > const&)' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::get_CacheResolution()' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundMgr::find(std::basic_string, std::allocator > const&)' /usr/lib/libsgenvironment.so: undefined reference to `glPopMatrix' /usr/lib/libsgenvironment.so: undefined reference to `SGNewCloud::cldCache' /usr/lib/libsgenvironment.so: undefined reference to `sgMakeTransMat4(float (*) [4], float const*)' /usr/lib/libsgenvironment.so: undefined reference to `sgSetCoord(sgCoord*, float const (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `ssgContext::getModelviewMatrix(float (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::enable3D' /usr/lib/libsgenvironment.so: undefined reference to `glPushMatrix' /usr/lib/libsgenvironment.so: undefined reference to `SGCloudField::set_CacheResolution(int)' /usr/lib/libsgenvironment.so: undefined reference to `glBindTexture' /usr/lib/libsgenvironment.so: undefined reference to `glEnable' /usr/lib/libsgenvironment.so: undefined reference to `SGSoundSample::play(bool)' /usr/lib/libsgenvironment.so: undefined reference to `calc_gc_course_dist(Point3D const&, Point3D const&, double*, double*)' /usr/lib/libsgenvironment.so: undefined reference to `glShadeModel' /usr/lib/libsgenvironment.so: undefined reference to `glTranslatef' /usr/lib/libsgenvironment.so: undefined reference to `glColor4f' /usr/lib/libsgenvironment.so: undefined reference to `glBlendFunc' /usr/lib/libsgenvironment.so: undefined reference to `sgPostMultMat4(float (*) [4], float const (*) [4])' /usr/lib/libsgenvironment.so: undefined reference to `glEnd' /usr/lib/libsgenvironment.so: undefined reference to `sgPreMultMat4(float (*) [4], float const (*) [4])' collect2: ld returned 1 exit status make: *** [metar] Error 1/ The first undefined reference is to /ssgCo
Re: [Flightgear-devel] 0.9.9 compile problem
Brian Thomson wrote: > I'm attempting to compile FlightGear 0.9.9 on Linspire 5.0. > Compiling simgear 0.9.9 went fine > > /usr/lib/libsgenvironment.so: undefined reference to Heh, methinks you're doing a bit more than "compiling" there. As a hint for the future: when you hack at your software and discover that you've instroduced a bug and need to ask for help, it generally works much better if you tell the developers what it is you have been doing. Your use of "attempting to compile" might otherwise lead us to believe that you were using the same build system that the rest of us are. :) Briefly: much of the "test" code in the trees likes to link against libraries which contain (unused) code that depends on other libraries. When the linker can see them all on the command line, it can figure it out. But the runtime linker isn't nearly so bright, and needs to be told explicitly which libraries to load in to resolve missing symbols. So your shared libraries either need to list all the dependent libraries when you link them, or you need to play games with LD_PRELOAD to make sure everything is there. Andy ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.9 compile problem
Thanks for the quick, helpful replies all. I'll add the additional libraries explicitly for the linker and see how it turns out. As far as my compiler, I'm using G++ 3.3. Heh, methinks you're doing a bit more than "compiling" there. As a hint for the future: when you hack at your software and discover that you've instroduced a bug and need to ask for help, it generally works much better if you tell the developers what it is you have been doing. Your use of "attempting to compile" might otherwise lead us to believe that you were using the same build system that the rest of us are. :) Perhaps I wasn't clear enough. I should have stated that I am attemtping to build 0.9.9 using the debian source package framework for 0.9.8, where the .a files are converted to shared object files. -Brian ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.9 compile problem
Brian Thomason wrote: > Perhaps I wasn't clear enough. I should have stated that I am > attemtping to build 0.9.9 using the debian source package framework > for 0.9.8, where the .a files are converted to shared object files. Apologies for my joking at your expense, I didn't notice your email address. :) Hrm... Why is debian shipping shared libraries for SimGear? As discussed, that is not the intended deployment mode for the upstream package (us!), so it seems awfully strange for debian (or Linspire?) to be making its own decisions there. Does it do the same for plib? I think most of us would honestly prefer that if Linspire users are going to install a FlightGear binary, it match the ones that we are developing on as closely as practical. SimGear really isn't designed to be a shared library anyway -- the various libsg*.a files just match the directory structure of the source code. As Alex pointed out, they have complicated dependency relationships that are going to be difficult to manage. Andy ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.9 compile problem
Andy Ross wrote: Brian Thomason wrote: Perhaps I wasn't clear enough. I should have stated that I am attemtping to build 0.9.9 using the debian source package framework for 0.9.8, where the .a files are converted to shared object files. Apologies for my joking at your expense, I didn't notice your email address. :) ;-) Hrm... Why is debian shipping shared libraries for SimGear? As discussed, that is not the intended deployment mode for the upstream package (us!), so it seems awfully strange for debian (or Linspire?) to be making its own decisions there. Does it do the same for plib? Yes. Debian policy, I believe. I think most of us would honestly prefer that if Linspire users are going to install a FlightGear binary, it match the ones that we are developing on as closely as practical. Works for me. I wasn't building it this way to break upstream's way of doing things - We just leverage Debian as much as possible and try to deviate as little as possible, but in this case, it isn't a big deal. SimGear really isn't designed to be a shared library anyway -- the various libsg*.a files just match the directory structure of the source code. As Alex pointed out, they have complicated dependency relationships that are going to be difficult to manage. I'll just repackage the whole thing. I tried manually adding the libs to the linker, and got some of the errors to go away, but others sprang up. Thanks again for the help. (Very fast responding, helpful community you have here) -Brian Andy ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.9 compile problem
> Hrm... Why is debian shipping shared libraries for SimGear? As > discussed, that is not the intended deployment mode for the upstream > package (us!), so it seems awfully strange for debian (or Linspire?) > to be making its own decisions there. Does it do the same for plib? FYI: we do have the source/package/debian/ subdir in the CVS, hosting Ove Kaaven's debian packaging scripts. > SimGear really isn't designed to be a shared library anyway -- the > various libsg*.a files just match the directory structure of the > source code. As Alex pointed out, they have complicated dependency > relationships that are going to be difficult to manage. > Hmmm what about fgsd and Atlas? they link against the same codebase, don't they? why not lower the use of the VM by sharing it? As it is, running atlas+fgfs on a lower-grade PC with an older 32Mb gfx card really hurts (although I believe in my case it's the graphics card that's the bottleneck, not the RAM). Personally, I welcome anyone's attempt to clean up the mess and have the debian framework work cleanly with the up-to-date code, but I have other priorities ahead of that on my personal TODO list for the flightgear. V. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.9 compile problem
Vassilii Khachaturov wrote: >> SimGear really isn't designed to be a shared library anyway -- the >> various libsg*.a files just match the directory structure of the >> source code. As Alex pointed out, they have complicated dependency >> relationships that are going to be difficult to manage. > Hmmm what about fgsd and Atlas? they link against the same codebase, > don't they? why not lower the use of the VM by sharing it? Look at the layout. PLIB and Simgear are both a bunch of small libraries and you only link those that you really need for your application. If the creators really had the intention of havind a shared lib then I presume they would have put everything into a single library (libplib.so and libsg.so), Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d