imacarthur wrote: > On 19 Jan 2010, at 21:56, Edward Hildum wrote: > > >> I'm using FLTK 1.1.9, installed as an RPM package under CentOS 5 >> (RHEL 5) and using Cmake 2.4 to build a third party application. >> > > I have never installed fltk from an RPM - always from the stock > tarball; installing from the tarball is trivially easy, so I've never > seen the point of anything else (configure ; make ; make install - > how hard can it be?) > > However - that puts things in /usr/local/include so it might be worth > checking that the RPM does actually put things in the system > location /usr/include (not /usr/local/include...) > > >> Depending on whether I set the compiler include directory to /usr/ >> include or /usr/include/Fl, I get different storms of error messages. >> > > Hmm, case sensitivity? That's FL not Fl - if the code came from OSX > or Windows there's a good chance header file names have the wrong > case and the original author never noticed - maybe? > > E.g. we see a lot of - should be: > > #include <FL/Fl_Window.H> > > but written as: > > #include <Fl/Fl_Window.h> > > still works on Windows and (some versions of OSX) as they are only > partly case-sensitive - but dies horribly on properly case-sensitive > file systems. > > Anyway: The correct include path should be /usr/include I would > expect, assuming the RPM is putting this into a system location > rather than a /usr/local location... > > > >> As I read the FLTK documentation, the proper method in C++ source >> files is: >> #include <FL/Fl_xyz.H> >> The include directive to the compiler should be -I/usr/include, >> or specified as /usr/include in the CMakeLists.txt file. >> > > Yup - looks right. > > > >> This results in many error messages about undefined references. >> > > Might help if you posted one or two so that we can see what it is > telling us. > > >> With include directive -I/usr/include/Fl, I get a different set of >> error messages regarding things defined in math.h. >> > > Yes - don't do that. > > >> I have had some success using GNU autotools, and using /usr/include/ >> Fl, but I have to rename the FL/math.h file to prevent it being >> used instead of the system math.h. >> > > That should be /usr/include (or if you built from the tarball > yourself then /usr/local/include unless you deliberately changed the > default prefix during configure.) > > Note that the FL subdirectory is FL and not Fl of fl or... > > If you explicitly add a path to /usr/include/FL then the compiler can > not disambiguate <math.h> from FL/math.h and you get the latter > problem you describe. > > > > _______________________________________________ > fltk mailing list > [email protected] > http://lists.easysw.com/mailman/listinfo/fltk > > I have also tried building the libraries from source (1.1.4, 1.1.8, 1.1.10), and they all seem to behave the same way. The CentOS RPM installs the libraries in /usr/lib and the includes in /usr/include/FL (with a symbolic link to also provide /usr/include/Fl). The source builds put them in /usr/local/lib and /usr/local/include/FL by default, though that can be changed using arguments to configure.
With Cmake, and the include directory set to /usr/include, I get zillions of errors of this sort: <snip> CMakeFiles/flP5.dir/gui/flP5.o: In function `cb_pb_calPrec': /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6532: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6533: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6534: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6535: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6536: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6540: undefined reference to `Fl_Wizard::prev()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6541: undefined reference to `Fl_Wizard::value()' CMakeFiles/flP5.dir/gui/flP5.o: In function `cb_pb_calNext': /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6493: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6494: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6495: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6496: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6497: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6498: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6499: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6500: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6504: undefined reference to `Fl_Wizard::next()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6505: undefined reference to `Fl_Wizard::value()' <snip> Now, with include directory /usr/include/FL: <snip> /home/ehildum/src/flP5/current-1.1.8/src/gui/main_flP5.cxx:1799: error: call of overloaded 'fabs(double)' is ambiguous /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/cmath:226: note: candidates are: float std::fabs(float) /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/cmath:230: note: long double std::fabs(long double) <snip> Clearly connected to the issue with math.h... There are none of the undefined reference messages, so either they are fixed or make gives up after seeing the new errors. Now, with include directory /usr/include/FL and FL/math.h renamed to FL/Fl_math.h: <snip> <CMakeFiles/flP5.dir/gui/flP5.o: In function `cb_pb_calPrec': /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6532: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6533: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6534: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6535: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6536: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6540: undefined reference to `Fl_Wizard::prev()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6541: undefined reference to `Fl_Wizard::value()' CMakeFiles/flP5.dir/gui/flP5.o: In function `cb_pb_calNext': /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6493: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6494: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6495: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6496: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6497: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6498: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6499: undefined reference to `Fl_Wizard::value()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6500: undefined reference to `Fl_Wizard::value(Fl_Widget*)' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6504: undefined reference to `Fl_Wizard::next()' /home/ehildum/src/flP5/current-1.1.8/src/gui/flP5.cxx:6505: undefined reference to `Fl_Wizard::value()' snip> Well, same errors as with /usr/include, so I guess there's some header problem. I do have a build system set up using GNU autotools that works, so I'll keep on using it for now. Thanks, Ted _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

