> 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()'
Let's see the link line.
Offhand it sounds like -lfltk is missing from the link line.
> 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>
Seems like the compiler is having a hard time figuring out
which of the std fabs() functions to use when you call it
from line 1799 in your main_flP5.cxx.
There must be some ambiguity where either of the candidates
shown could work, and it's not sure what to do.
Try modifying your code to casting both the argument and the
return value so that it's clear to the compiler which overload
it should use (the floating or non-floating version), eg. if
you want the input and return to be a float, then use:
yourval = (float)fabs((float)(your_args_here));
My guess is that either the argument or the return value
or both are neither long or float, and it's having a hard time
figuring out which is right to use.
I'd say the above is unrelated to FLTK's math include file entirely.
> Now, with include directory /usr/include/FL and FL/math.h renamed to
> FL/Fl_math.h:
I wouldn't rename FL/math.h to something else.
FL's math.h should not collide with anything in the OS.
The only way it would is if you had something like -I/usr/include/FL
or -I/usr/include/Fl on the compile line, either of which is wrong,
and would cause overlaps.
Make sure your compile line does not have -I/any/thing/FL
and make sure your link line uses -lfltk and all the other
libs it needs to build.
If the FLTK include files are in some dir other then /usr/include,
then you would want e.g.:
-I/some/dir/fltk-x.x.x
..and /not/:
-I/some/dir/fltk-x.x.x/FL
-I/some/dir/fltk-x.x.x/Fl
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk