Re: static executable, can't open $DISPLAY - RESOLVED



On 14 Mar 2002 10:22:09 -0500
Havoc Pennington <hp redhat com> wrote:

> Ian Britten <britten caris com> writes: 
> > I'm working on Linux (Mandrake 8.1, gcc 3.0.1, etc) with gtk 1.2.10 (Ximian)
> > When I build a dynamic executable, everything works find, as expected.
> > When I build a static executable (-static linker option), I can't run the
> > executable any more.  When I try, I get the following output:
> > 
> > % ./a.out
> > 
> > Gdk-WARNING **: locale not supported by Xlib, locale set to C
> > 
> > Gdk-WARNING **: can not set locale modifiers
> > 
> > Gtk-WARNING **: cannot open display: :0
> >
> 
> Maybe you statically linked to libc so it can't dlopen() its locale
> data correctly?

FYI...
I switched from using the single -static option to pairs of
"-Xlinker -Bstatic"/"-Xlinker -Bdynamic" options around the various
libraries.  I eventually tracked this problem down to the X libraries...
Linking them (-lXi -lXext -lX11) in dynamically immediately solved the
problem.

Thanks for your help, Havoc!
Ian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]