Hi, I''m an experienced programmer (mostly perl for the last 10 years) who is very new to Ruby. I have just installed Foxgui on my powerbook and am now attempting to install FXRuby. The setup step results in some undefined symbols when building fox14.bundle. output from the config step: [rful011 at bluebottle FXRuby-1.4.3]$ruby install.rb config install.rb: entering config phase... ---> lib ---> lib/fox14 <--- lib/fox14 <--- lib ---> ext ---> ext/fox14 /sw/bin/ruby1.8 /Users/rful011/src/FXRuby-1.4.3/ext/fox14/extconf.rb checking for sys/time.h... yes checking for signal.h... yes checking for png_create_read_struct() in -lpng... no checking for deflate() in -lz... no checking for jpeg_mem_init() in -ljpeg... no checking for TIFFSetErrorHandler() in -ltiff... no checking for XShmQueryVersion() in -lXext... no checking for XFindContext() in -lX11... no checking for glXCreateContext() in -lGL... no checking for gluNewQuadric() in -lGLU... no creating Makefile ---> ext/fox14/include <--- ext/fox14/include <--- ext/fox14 <--- ext install.rb: config done. and the end of the setup step: cc -dynamic -bundle -read_only_relocs suppress -L"/sw/lib" -L"/usr/local/lib" -o fox14.bundle librb.o core_wrap.o dc_wrap.o dialogs_wrap.o frames_wrap.o fx3d_wrap.o FXRbApp.o FXRbDataTarget.o FXRbGLViewer.o FXRuby.o iconlist_wrap.o icons_wrap.o image_wrap.o impl.o label_wrap.o layout_wrap.o list_wrap.o markfuncs.o mdi_wrap.o menu_wrap.o table_wrap.o text_wrap.o treelist_wrap.o ui_wrap.o unregisterOwnedObjects.o -lruby -lFOX-1.4 -lstdc++ -ldl -lobjc /usr/bin/ld: Undefined symbols: FX::fxcheckJPG(FX::FXStream&) FX::fxcheckPNG(FX::FXStream&) FX::fxcheckTIF(FX::FXStream&) collect2: ld returned 1 exit status make: *** [fox14.bundle] Error 1 The link between the undefined symbols and the messages from the setup relating to png, jpg and tiff libraries has not escaped me however I do not know exactly what it means. libtiff, libjpeg and libtpng are all installed in /sw/lib I''m using the Apple XCode compiler and the X distribution that comes with Tiger. Clearly I''m missing something. Any help appreciated. Cheers, Russell
On Nov 19, 2005, at 1:38 AM, Russell Fulton wrote:> The link between the undefined symbols and the messages from the setup > relating to png, jpg and tiff libraries has not escaped me however I do > not know exactly what it means. > > libtiff, libjpeg and libtpng are all installed in /sw/lib > > I''m using the Apple XCode compiler and the X distribution that comes > with Tiger. > > Clearly I''m missing something. Any help appreciated.It sounds as though the FOX library (which you built earlier) was compiled without JPEG, GIF and PNG support. Am I correct to assume that since you have libjpeg and friends installed in /sw/lib, that you''re using Fink? If so, it should be that the include files for those libraries are present in /sw/include. Check to see if, for example, there''s a /sw/include/jpeglib.h. If those include files are there, it''s probably just that you didn''t configure the FOX built to look in the /sw/include directory for include files. If it doesn''t know to look there, it''s not going to find jpeglib.h (and friends) and so it''s going to assume that you don''t have those libraries installed. To configure FOX to look there (in addition to the directories that it searches by default), try: cd fox-1.4.x setenv CPPFLAGS -I/sw/include setenv LDFLAGS "-L/sw/lib -L/usr/X11R6/lib" ./configure Watch the messages generated by "configure" for stuff relating to GIF, PNG and JPEG, and make sure that it''s finding those libraries. Then you''ll type: make to recompile FOX, this time with support for those libraries. You shouldn''t need to re-compile FXRuby when it''s done, just re-link it and it should be fine. Hope this helps, Lyle
Jeroen van der Zijp
2005-Nov-19 19:52 UTC
[fxruby-users] Installing RubyFX on MacOS X 10.4.3
On Saturday 19 November 2005 10:50, Lyle Johnson wrote:> One of my users just discovered a problem with FXRuby that was > surprising to me and so I thought I''d mention it here. > > If your FOX application''s source code has references to the > fxcheckJPG() function, it will always compile correctly against the FOX > header files; but if you link your application against a FOX library > that wasn''t built with JPEG support, you''re going to find that > fxcheckJPG() is an unresolved symbol. That is to say, there''s no > "stubbed in" version of fxcheckJPG() for a FOX library that''s built > without JPEG support. > > This is different from the pattern previously established in FOX for, > say, the FXJPGIcon class. If your source code has references to the > FXJPGIcon class, it will compile and link correctly against a FOX > library built without JPEG support. The resulting application will even > construct an FXJPGIcon object, and just display a placeholder icon in > place of the actual image. > > So... I''d like to request that future FOX libraries provide stubbed-in, > "do nothing" version of the fxcheckJPG(), fxcheckGIF() and fxcheckPNG() > functions. I understand that they won''t do the right thing, but it > seems like that''s OK given the precedents I''ve mentioned.Indeed, you are right. The idea with stubbing out if no image support is available is to allow programs to continue to compile [and function!]. I''ve looked things over and we have this problem in three different places:- for JPEG, PNG and TIFF support. The other image types are OK as they are always compiled in [no external libraries are required]. I''ve fixed these and one other minor problem and dropped the fixed sources at: ftp://fox-toolkit.org/pub/fox-1.4.25.tar.gz Hopefully, that takes care of the problem! Regards, Jeroen
Thanks to Lyle I now have everything compiling and installing without obvious errors. For the archive (if there is one) the problem was that fink does not have dev versions (i.e. packages that includes the compiler header files) of the many of the libraries. What I did in the end was to get the source of the packages from their respective homes and install them from scratch. This should have fixed the problem but for reasons completely beyond me the new version of libjepg caused the build of some of the fox libraries to die with errors relating to the table of contents and suggestions that I should run ranlib on the library to rebuild the toc. Running ranlib did not fix the problem (surprise ;). So I then reinstalled libjpeg from fink over the version I build from source leaving the the headers files in place. This allowed fox to build and install without obvious errors. Now FXRuby setup died with an error saying it could not locate one libtiff.3.dymn (or something like that) I looked at the files in /sw/lib and put a link in for this file pointing to the library which had the full version number in its name. Now everything appears to load and install nicely. However (you guessed it ;) when I try and run the examples I get: rful011 at bluebottle FXRuby-1.4.3]$examples/browser.rb /sw/lib/ruby/site_ruby/1.8/powerpc-darwin/fox14.bundle: [BUG] Bus Error ruby 1.8.1 (2003-12-25) [powerpc-darwin] Abort trap Confession time: I did not disable GL in building fox as per instructions (reasoning: the instruction appeared to be quite old -- I know tiger supports GL so I decided to suck and see). I also came across stuff on the web suggesting that the apple supplied ruby was misconfigured and that one had to fiddle with rbconfig.rb. I have not done this (on the grounds that one should not fix things until you are sure they are broken ;) So are the bus errors consistent with either of these potential issues or should I be looking elsewhere. When I get his going I volunteer to update the instructions for building stuff on a tiger using apples Xcode and fink. Cheers, Russell
On Nov 20, 2005, at 8:44 PM, Russell Fulton wrote:> Thanks to Lyle I now have everything compiling and installing without > obvious errors. For the archive (if there is one) the problem was that > fink does not have dev versions (i.e. packages that includes the > compiler header files) of the many of the libraries. What I did in the > end was to get the source of the packages from their respective homes > and install them from scratch.Very curious. I got all of the packages in question from fink and managed to get the needed header files. I am still running Mac OS 10.3 (haven''t upgraded to Tiger) and so I don''t know if they''ve changed things for the newer fink distributions.> Confession time: > I did not disable GL in building fox as per instructions (reasoning: > the > instruction appeared to be quite old -- I know tiger supports GL so I > decided to suck and see).Yes, OpenGL should work fine. Where did you find a suggestion to build FOX without OpenGL support? We need to get that advice out of circulation.> I also came across stuff on the web suggesting that the apple supplied > ruby was misconfigured and that one had to fiddle with rbconfig.rb. I > have not done this (on the grounds that one should not fix things until > you are sure they are broken ;)Yes, I have also heard this about the Ruby included with Tiger. The patch that''s out there fixing a problem related to building C extensions (like FXRuby) and so I imagine it''s worth investigating that.> When I get his going I volunteer to update the instructions for > building > stuff on a tiger using apples Xcode and fink.That would be great. I still haven''t upgraded to Tiger and don''t get a lot of feedback from Mac OS X users.
Here''s my experience with Tiger (Mac OS X 10.4.3) on a couple of PowerBooks. My skill with C begins and ends with "./configure; make; sudo make install" so .... Fox 1.4.x compiles as-is from source from the command line if you have the Apple developer tools installed. The example programs work as they should -- if you remember to start your X server first. On OS X 10.4.2, FXRuby (source or gem) wouldn''t compile for me without the fixrbconfig gem. I am not sure if this is still necessary with 10.4.3, but I suspect so. With the "fix," FXRuby compiles, but any attempt to use it dies with: Module() error Symbol not found in flat namespace __ZN2FX10fxcheckJPGERNS_8FXStreamE The DarwinPorts FXRuby port _does_ work, but it''s at version 1.2. I made my own local port, changed all the "1.2"''s to "1.4"''s, and that worked, too. So, what''s different in DarwinPorts? Obviously, the link error points toward a missing JPEG library, and the only dependencies listed in the Portfile are libtiff, libpng, libjpeg, and libX11 for Fox. And "otool -L libFOX-1.4.0.dylib" shows the images libs as the only difference between working builds. Long story short, I copied my DarwinPorts versions of libtiff, libpng, libjpeg into /usr/lib on another PowerBook that does not have DarwinPorts nor Fink; recompiled Fox and FXRuby from source; and it worked. I would bet that if OS X users download and compile the "Image Formats" libs on the Fox Download page first, we would be able to compile and run FXRuby, but I haven''t put that to the test. Hope that helps, Scott On Nov 20, 2005, at 7:05 PM, Lyle Johnson wrote:> > On Nov 20, 2005, at 8:44 PM, Russell Fulton wrote: > >> Thanks to Lyle I now have everything compiling and installing without >> obvious errors. For the archive (if there is one) the problem was >> that >> fink does not have dev versions (i.e. packages that includes the >> compiler header files) of the many of the libraries. What I did >> in the >> end was to get the source of the packages from their respective homes >> and install them from scratch. > > Very curious. I got all of the packages in question from fink and > managed to get the needed header files. I am still running Mac OS 10.3 > (haven''t upgraded to Tiger) and so I don''t know if they''ve changed > things for the newer fink distributions. > >> Confession time: >> I did not disable GL in building fox as per instructions (reasoning: >> the >> instruction appeared to be quite old -- I know tiger supports GL so I >> decided to suck and see). > > Yes, OpenGL should work fine. Where did you find a suggestion to build > FOX without OpenGL support? We need to get that advice out of > circulation. > >> I also came across stuff on the web suggesting that the apple >> supplied >> ruby was misconfigured and that one had to fiddle with >> rbconfig.rb. I >> have not done this (on the grounds that one should not fix things >> until >> you are sure they are broken ;) > > Yes, I have also heard this about the Ruby included with Tiger. The > patch that''s out there fixing a problem related to building C > extensions (like FXRuby) and so I imagine it''s worth investigating > that. > >> When I get his going I volunteer to update the instructions for >> building >> stuff on a tiger using apples Xcode and fink. > > That would be great. I still haven''t upgraded to Tiger and don''t get a > lot of feedback from Mac OS X users. > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users
Hi Scott, Thanks for describing your experience and apologies for taking so long to get back to you. This is a back burner project for me and now that it''s weekend I''ve got some time to have another go. I too ran into the image lib problems and ''solved'' them by installing from source the libraries from source. I then ran into issues with libjpeg refusing to load and ended up copying the version from Fink back over the one I installed from source (after checking that they were built from the same version). I still don''t know what was going on here. I tried rebuilding the libjpeg with the version from the fox distribution site but, so far as I can tell it was identical to the one I installed. I have a horrible feeling that something got left from one of my aborted install attempts and is now poisoning everything I try. My next strategy will be to go through /usr/local/ and /sw and remove all files created since I started play with fox and starting again from scratch. I''m also going to uninstall the image libs from fink. fingers firmly crossed:) Russell
OK, I just got hello world up on the screen! It only took about 20 hours :) It turns out that the install is reasonably straight forward so long as you don''t first shoot yourself in both feet by having two Ruby installs on your machine ;) When I starter paying with ruby I had not realised that tiger installed ruby and so I had installed it from fink and by the time I came to play with FXRuby I had forgotten this. Once I used dselect to remove the fink version of Ruby thing started working much better. This also explained why I was able to compile extensions without running the the fix program. There are still issues with the graphics libraries and these can be very confusing and difficult to diagnose. The problem being that fox and builds quite happily without them but things come unstuck with FXRuby because it assumes they are in the links are in fox.bundle so you either get an error running install.rb setup or when you run any fxruby app (depending on the exact circumstance). It would be helpful if the fxruby config step could check for the existence of the routines in foxlib and give plain English statement of the problem. One other complication is that not only do you need the libraries you also need the include files to build foxlib properly. Fink does not have dev versions of any of the libraries (i.e. the fink packages do *not* include the header files). It is therefore best to install all the image libraries from source. There are convenient links to the necessary tar balls on the fox download page -- I also installed zlib and bz2. The last piece of the puzzle is that (for reasons unknown and possibly specific to my setup) the libjpeg.a file that I installed had something screwed with its table of contents and I had to run ranlib to fix this. So I ended up taking much longer than I should have to do what is really quite a straight forward job. One other thing that tripped me up was that I ended up with some libraries installed in /usr/local and some in /sw (why oh why does fink install stuff in /sw?? NO I really don''t want to know ;) my powerbook is now covered in bloody footprints ;) My excuse is that this is the first time I have tried to install any substantial software from source under Mac OS. Oh yes, I''m also getting old and stupid :) So how does one go about installing fox/fxruby on MacOS 10.4? 1/ Install Apple Xcode tools (if not already installed) and copy the tarballs for fox and fxruby to somewhere convenient. 2/ You also need to download and run the fix script so that the Apple supplied ruby can build extensions. sudo gem install fixrbconfig sudo fixrbconfig 3/ check the prerequisite libraries (png, tiff and jpeg) *and* include files in both /usr/local and /sw (libraries in lib/ and include in include/ -- files in lib/ have lib prepended to the name e.g. libpng). If any are missing then rebuild that package from source (links on the the fox download page). All packages install in /usr/local by default so if you have installed the from fink but are missing the include files the use dselect to uninstall them first. I had to run ranlib on libjpeg.a: sudo ranlib /usr/local/lib/libjpeg.a now you should be able to install fox and fxruby following the usual instructions. The key to a successful install is to have the graphic libraries all present and correct *before* you start installing fox. Lyle: Please feel free to use this material to update the fxruby install web pages. One last note: When I did my final build of fox.bundle (which I did by descending into ext/fox, removing fox.bundle and running make) I got a whole bunch of duplicate symbol warning for various tiff routines which ld found in both libtiff and libfox. I''m not sure what that was about but the fox.bundle that resulted seems to work just fine. Cheers, Russell
Thanks for the detailed write-up. I think you are right that previous broken installs can "pollute" your current install, even when you have everything right. Scott On Nov 26, 2005, at 11:16 AM, Russell Fulton wrote:> OK, I just got hello world up on the screen! It only took about 20 > hours :) > > It turns out that the install is reasonably straight forward so > long as > you don''t first shoot yourself in both feet by having two Ruby > installs > on your machine ;) > > When I starter paying with ruby I had not realised that tiger > installed > ruby and so I had installed it from fink and by the time I came to > play > with FXRuby I had forgotten this. Once I used dselect to remove the > fink version of Ruby thing started working much better. This also > explained why I was able to compile extensions without running the the > fix program. > > There are still issues with the graphics libraries and these can be > very > confusing and difficult to diagnose. The problem being that fox and > builds quite happily without them but things come unstuck with FXRuby > because it assumes they are in the links are in fox.bundle so you > either > get an error running install.rb setup or when you run any fxruby app > (depending on the exact circumstance). > > It would be helpful if the fxruby config step could check for the > existence of the routines in foxlib and give plain English > statement of > the problem. > > One other complication is that not only do you need the libraries you > also need the include files to build foxlib properly. Fink does not > have dev versions of any of the libraries (i.e. the fink packages do > *not* include the header files). It is therefore best to install all > the image libraries from source. There are convenient links to the > necessary tar balls on the fox download page -- I also installed zlib > and bz2. > > The last piece of the puzzle is that (for reasons unknown and possibly > specific to my setup) the libjpeg.a file that I installed had > something > screwed with its table of contents and I had to run ranlib to fix > this. > > So I ended up taking much longer than I should have to do what is > really > quite a straight forward job. One other thing that tripped me up was > that I ended up with some libraries installed in /usr/local and > some in > /sw (why oh why does fink install stuff in /sw?? NO I really don''t > want > to know ;) my powerbook is now covered in bloody footprints ;) My > excuse is that this is the first time I have tried to install any > substantial software from source under Mac OS. Oh yes, I''m also > getting > old and stupid :) > > So how does one go about installing fox/fxruby on MacOS 10.4? > > 1/ Install Apple Xcode tools (if not already installed) and copy the > tarballs for fox and fxruby to somewhere convenient. > > 2/ You also need to download and run the fix script so that the Apple > supplied ruby can build extensions. > > sudo gem install fixrbconfig > sudo fixrbconfig > > 3/ check the prerequisite libraries (png, tiff and jpeg) *and* include > files in both /usr/local and /sw (libraries in lib/ and include in > include/ -- files in lib/ have lib prepended to the name e.g. > libpng). > > If any are missing then rebuild that package from source (links on the > the fox download page). All packages install in /usr/local by default > so if you have installed the from fink but are missing the include > files > the use dselect to uninstall them first. > > I had to run ranlib on libjpeg.a: > > sudo ranlib /usr/local/lib/libjpeg.a > > now you should be able to install fox and fxruby following the usual > instructions. > > The key to a successful install is to have the graphic libraries all > present and correct *before* you start installing fox. > > Lyle: Please feel free to use this material to update the fxruby > install web pages. > > One last note: When I did my final build of fox.bundle (which I > did by > descending into ext/fox, removing fox.bundle and running make) I got a > whole bunch of duplicate symbol warning for various tiff routines > which > ld found in both libtiff and libfox. I''m not sure what that was about > but the fox.bundle that resulted seems to work just fine. > > Cheers, Russell > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users
Thought I''d follow-up on my earlier post. While it is possible to compile libtiff, libjpeg, etc... on OS X without Fink or Darwin Ports, I wouldn''t recommend it unless you enjoy setting compiler flags and modifying library search paths. It''s not hard if you know what you''re doing, but most people should use Fink or Darwin Ports for the dependent libs. I gave up once I hit problems with FXScintilla and XFT, and just used Fink for those. Hope that helps someone, Scott On Nov 21, 2005, at 7:23 AM, Scott Willson wrote:> I would bet that if OS X users download and compile the "Image > Formats" libs on the Fox Download page first, we would be able to > compile and run FXRuby, but I haven''t put that to the test.
Scott Willson wrote:> Thought I''d follow-up on my earlier post. While it is possible to > compile libtiff, libjpeg, etc... on OS X without Fink or Darwin > Ports, I wouldn''t recommend it unless you enjoy setting compiler > flags and modifying library search paths. It''s not hard if you know > what you''re doing, but most people should use Fink or Darwin Ports > for the dependent libs. >I have not looked at the darwin ports (I must at some stage) but fink does not have development version of the graphics libraries (i.e. packages that include the .h files as well as the libraries) so that when you come to build fox it builds without these libraries which in turn causes the build of foxxx.bundle to fail. That''s why I had to reinstall the libraries from scratch after removing them from fink. Hmmm... just visited the Darwin Ports site and, so far as I can tell with out actually downloading and examining the packages they do not contain the include files. I base this conclusion on the fact that some of the packages are classed as graphics-devel and others (including our friends are just graphics). I''d be delighted to be proved wrong. BTW as far as I can remember all three of the libraries compiled without any more configuration than ./configure and make. I let them install in /usr/local/ and fox found them there without problems (it defines -L/sw/lib & -L/usr/local/lib). Russell.
On Dec 4, 2005, at 12:18 PM, Russell Fulton wrote:> > > Scott Willson wrote: >> Thought I''d follow-up on my earlier post. While it is possible to >> compile libtiff, libjpeg, etc... on OS X without Fink or Darwin >> Ports, I wouldn''t recommend it unless you enjoy setting compiler >> flags and modifying library search paths. It''s not hard if you know >> what you''re doing, but most people should use Fink or Darwin Ports >> for the dependent libs. >> > I have not looked at the darwin ports (I must at some stage) but fink > does not have development version of the graphics libraries (i.e. > packages that include the .h files as well as the libraries) so that > when you come to build fox it builds without these libraries which in > turn causes the build of foxxx.bundle to fail. > > That''s why I had to reinstall the libraries from scratch after > removing > them from fink. > > Hmmm... just visited the Darwin Ports site and, so far as I can tell > with out actually downloading and examining the packages they do not > contain the include files. I base this conclusion on the fact that > some > of the packages are classed as graphics-devel and others (including > our > friends are just graphics). > > I''d be delighted to be proved wrong. > > BTW as far as I can remember all three of the libraries compiled > without > any more configuration than ./configure and make. I let them > install in > /usr/local/ and fox found them there without problems (it defines > -L/sw/lib & -L/usr/local/lib). > > Russell. > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-usersYeah, hmmm. It''s hard to be definitive with the number of things that can vary across installs, unless you take the time do a clean install and record your steps. I can say that I have FXRuby on an old PowerBook that has Tiger + dev tools + Fink and not much else, and I''ve got this in /sw/include: bzlib.h curses.h cursesapp.h cursesf.h cursesm.h cursesp.h cursesw.h cursslk.h eti.h etip.h form.h iconv.h jconfig.h jerror.h jmorecfg.h jpeglib.h libcharset.h libintl.h libpng -> libpng12 libpng12 localcharset.h menu.h ncurses.h -> curses.h ncurses_dll.h panel.h png.h -> libpng12/png.h pngconf.h -> libpng12/pngconf.h term.h termcap.h tiff.h tiffconf.h tiffio.h tiffvers.h unctrl.h So I''d wager that Fink does install the header files. I have "use unstable" set, and I installed the libjpeg, libjpeg-bin, and libjpeg- shlibs packages. I''m not as sure about Darwin Ports, as I used that on a much "messier" PowerBook, but I''ve got libjpg.h, libpng.h, etc. in /opt/ local/include/ Hope those are helpful data points, Scott
> > Yeah, hmmm. It''s hard to be definitive with the number of things that > can vary across installs, unless you take the time do a clean install > and record your steps.Agreed! that is one thing thing I really like about linux. I can grab any old hardware (or a VM) do a nice clean install and then start from a known position. With MacOS it is just about impossible. Russell