On 11/05/14 09:52, Greg Ercolano wrote:
> Since I can't replicate, I can't verify this is the issue, but maybe
> try changing this line in FL/x.H:
>
> BEFORE: class Fl_XFont_On_Demand
> AFTER: class FL_EXPORT Fl_XFont_On_Demand
>
> ..and then do a '( make clean; make )'..?
Doing some tests, I have a higher confidence the above may help the OP.
That change seems to help Fl_XFont_On_Demand::value() change from "HIDDEN" to "DEFAULT":
BEFORE:
$ readelf -Ws libfltk.a | grep Fl_XFont_On_Demand
127: 0000000000000000 739 FUNC GLOBAL HIDDEN 33 _ZN18Fl_XFont_On_Demand5valueEv
^^^^^^
AFTER:
$ readelf -Ws libfltk.a | grep Fl_XFont_On_Demand
127: 0000000000000000 739 FUNC GLOBAL DEFAULT 33 _ZN18Fl_XFont_On_Demand5valueEv
^^^^^^^
As a side note: perhaps we should add "-z,defs" to the -Wl flag
which seems to force detecting this kind of thing.
The following page gave me this idea:
http://stackoverflow.com/questions/1617286/easy-check-for-unresolved-symbols-in-shared-libraries
For example, on my system that seems to build shared FLTK libs without error,
and the cube demo runs just fine, if I make the following change to the makeinclude:
BEFORE: DSOCOMMAND = $(CXX) $(DSOFLAGS) -Wl,-soname,$@ $(LDLIBS) -shared -fPIC -o
AFTER: DSOCOMMAND = $(CXX) $(DSOFLAGS) -Wl,-z,defs,-soname,$@ $(LDLIBS) -shared -fPIC -o
..then during a rebuild, it complains right away about Fl_XFont_On_Demand not being
defined when the above FL_EXPORT is not included, looking very similar to the OP's
error.
I get this error early, during construction of the lib (not during link of the cube demo):
gl_draw.o: In function `gl_font(int, int)':
gl_draw.cxx:(.text._Z7gl_fontii+0x3b): undefined reference to `Fl_XFont_On_Demand::value()'
collect2: ld returned 1 exit status
make[1]: *** [libfltk_gl.so.1.3] Error 1
make[1]: Leaving directory `/usr/local/src/fltk-1.3.x-svn/src'
make: *** [all] Error 1
..and if I put the FL_EXPORT back (suggested change), that error goes away
and all of FLTK builds OK.
So in other words, making that change may help us detect unresolved symbols
during development on systems that might otherwise not show the problem.
Just a thought, I don't fully understand shared builds on linux, and don't
consider my understanding complete on the matter; I'm definitely no guru
regarding shared lib builds.