-----Original Message-----
From: Bryn M. Reeves <bmr@redhat.com>
Reply-to: Development discussions related to Fedora <devel@lists.fedoraproject.org>
To: Development discussions related to Fedora <devel@lists.fedoraproject.org>
Cc: Miloslav Trmač <mitr@volny.cz>
Subject: Re: fltk
Date: Wed, 19 Dec 2012 18:01:40 +0000

On 19/12/12 17:30, Miloslav Trmač wrote:
> On Wed, Dec 19, 2012 at 6:27 PM, Bryn M. Reeves <bmr@redhat.com> wrote:
>> On Fedora the following command fails:
>>
>> g++ -I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
>> -D_THREAD_SAFE -D_REENTRANT -pipe -Wall -fexceptions -O2 -ffast-math
>> -finline-functions -fomit-frame-pointer   -DNDEBUG -g -O2   -o flrig
>> [...] -Wl,-Bsymbolic-functions -lfltk_images -lfltk  -ldl  -lrt  -lpthread
>>
>> While on Ubuntu it works (run in a similarly prep'ed source tree);
>> something appears to be "magically" adding -lX11 during the link step on
>> Ubuntu
> Probably http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking
>    Mirek
> 

So it seems to be down to the fact that flrig includes <FL/x.H>:

$ fgrep 'FL/x.H' rig.cxx
#include <FL/x.H>
#include <FL/x.H>

>From FL/x.h:

// These are internal fltk symbols that are necessary or useful for
// calling Xlib.  You should include this file if (and ONLY if) you
// need to call Xlib directly.  These symbols may not exist on non-X
// systems.

There are macros further on that use XCreatePixmap in their definition:

#   define fl_create_offscreen(w,h) \
  XCreatePixmap(fl_display, \
              (Fl_Surface_Device::surface()->class_name() ==
Fl_Display_Device::class_id ? \
              fl_window : fl_xid(Fl::first_window()) ) , \
              w, h, fl_visual->depth)

So I'd say that fltk apps that use this header really do need to specify
-lX11 in their own LDFLAGS as they will need these symbols directly.

So it's an flrig bug.

It's easy to work around:

$ LDFLAGS="-lX11" ./configure && make
[...]
$ ldd src/flrig
	linux-vdso.so.1 =>  (0x00007fffccb82000)
	libX11.so.6 => /lib64/libX11.so.6 (0x0000003c77600000)
[...]

I couldn't see where to report bugs on w1hkj.com...

Regards,
Bryn.

So why does this bug not show itself on Suse, and any of the Debian based builds?

vk4tux