Tk installation woes

Discussion in 'Perl Misc' started by Miro, Oct 2, 2011.

  1. Miro

    Miro Guest

    Greetings, gents.

    I picked up Mastering Perl/Tk at my local library, and, anxious to try
    it out on my home Slackware system, I downloaded Tk from CPAN, and
    cd'ed into the directory.

    perl Makefile.PL worked with no problem, however "make" gives me
    this...

    cc -c -I.. -I/usr/X11R6/include -I. -Ibitmaps -I/usr/X11R6/include -
    D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector
    -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -
    march=i486 -mtune=i686 -DVERSION=\"804.027\" -DXS_VERSION=
    \"804.027\" -fPIC "-I/usr/lib/perl5/5.12.3/i486-linux-thread-multi/
    CORE" -Wall -Wno-implicit-int -Wno-comment -Wno-unused -
    D__USE_FIXED_PROTOTYPES__ Xlib_f.c
    In file included from Xlib_f.c:8:0:
    Xlib.h:22:15: error: conflicting types for 'XKeycodeToKeysym'
    /usr/include/X11/Xlib.h:1694:15: note: previous declaration of
    'XKeycodeToKeysym' was here
    make[1]: *** [Xlib_f.o] Error 1
    make[1]: Leaving directory `/home/miro/Downloads/Tk-804.027/pTk'
    make: *** [pTk/libpTk.a] Error 2

    I'm not exactly a Perl (or manual compilation) guru, can anyone tell
    me what I must do?
    Miro, Oct 2, 2011
    #1
    1. Advertising

  2. Miro <> wrote:
    > Greetings, gents.


    > I picked up Mastering Perl/Tk at my local library, and, anxious to try
    > it out on my home Slackware system, I downloaded Tk from CPAN, and
    > cd'ed into the directory.


    > perl Makefile.PL worked with no problem, however "make" gives me
    > this...


    > cc -c -I.. -I/usr/X11R6/include -I. -Ibitmaps -I/usr/X11R6/include -
    > D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector
    > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -
    > march=i486 -mtune=i686 -DVERSION=\"804.027\" -DXS_VERSION=
    > \"804.027\" -fPIC "-I/usr/lib/perl5/5.12.3/i486-linux-thread-multi/
    > CORE" -Wall -Wno-implicit-int -Wno-comment -Wno-unused -
    > D__USE_FIXED_PROTOTYPES__ Xlib_f.c
    > In file included from Xlib_f.c:8:0:
    > Xlib.h:22:15: error: conflicting types for 'XKeycodeToKeysym'
    > /usr/include/X11/Xlib.h:1694:15: note: previous declaration of
    > 'XKeycodeToKeysym' was here
    > make[1]: *** [Xlib_f.o] Error 1
    > make[1]: Leaving directory `/home/miro/Downloads/Tk-804.027/pTk'
    > make: *** [pTk/libpTk.a] Error 2


    > I'm not exactly a Perl (or manual compilation) guru, can anyone tell
    > me what I must do?


    It's not a Perl problem but might be a bug in the C code
    of Tk, probably the one discussed here:

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613188

    There's also a proposed patch by Dominique Dumont I append in full
    at the end. It consists of inserting into 'perl-tk-804.029/pTk/Xlib.h'
    (or 'perl-tk-804.027/pTk/Xlib.h' in your case) a line with

    #ifndef _X11_XLIB_H_

    before the line with

    extern XFontStruct *XLoadQueryFont _ANSI_ARGS_((Display *, const char *));

    and another line with

    #endif /* _X11_XLIB_H_ */

    after the line with

    extern int XSubtractRegion _ANSI_ARGS_((Region, Region, Region));

    I can't promise that this will really fix the problem but it
    might be worth a try.
    Regards, Jens

    -----------------------8<------------------------------------
    #! /bin/sh /usr/share/dpatch/dpatch-run
    ## fix-ftbs.dpatch by Dominique Dumont <>
    ##
    ## All lines beginning with `## DP:' are a description of the patch.
    ## DP: Added a test that protect against double inclusion with recent
    ## DP: versions of Xlib.h provided by Xorg. The original test with X_LIB_H_
    ## DP: was not changed to avoid breaking build when backporting perl-tk
    ## DP: on older versions of Xorg.

    @DPATCH@
    diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git'
    '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr'
    perl-tk-804.029~/pTk/Xlib.h perl-tk-804.029/pTk/Xlib.h
    --- perl-tk-804.029~/pTk/Xlib.h 2007-02-10 09:55:23.000000000 +0100
    +++ perl-tk-804.029/pTk/Xlib.h 2011-04-20 17:37:27.000000000 +0200
    @@ -1,6 +1,7 @@
    #ifndef _XLIB
    #define _XLIB
    #ifndef _XLIB_H_
    +#ifndef _X11_XLIB_H_
    extern XFontStruct *XLoadQueryFont _ANSI_ARGS_((Display *, const char *));
    extern XModifierKeymap *XGetModifierMapping _ANSI_ARGS_((Display *));
    extern XImage *XCreateImage _ANSI_ARGS_((Display *, Visual *, unsigned int,
    int, int, char *, unsigned int, unsigned int, int, int));
    @@ -143,6 +144,7 @@
    extern Window XGetSelectionOwner _ANSI_ARGS_((Display *, Atom));
    extern int XRectInRegion _ANSI_ARGS_((Region,int,int,unsigned,unsigned));
    extern int XSubtractRegion _ANSI_ARGS_((Region, Region, Region));
    +#endif /* _X11_XLIB_H_ */
    #endif /* _XLIB_H_ */
    extern int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image));
    #endif /* _XLIB */
    -----------------------8<------------------------------------

    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
    Jens Thoms Toerring, Oct 2, 2011
    #2
    1. Advertising

  3. Miro

    Miro Guest

    On Oct 2, 9:12 am, (Jens Thoms Toerring) wrote:
    > Miro <> wrote:
    > > Greetings, gents.
    > > I picked up Mastering Perl/Tk at my local library, and, anxious to try
    > > it out on my home Slackware system, I downloaded Tk from CPAN, and
    > > cd'ed into the directory.
    > > perl Makefile.PL worked with no problem, however "make" gives me
    > > this...
    > > cc -c  -I.. -I/usr/X11R6/include -I. -Ibitmaps -I/usr/X11R6/include -
    > > D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector
    > > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -
    > > march=i486 -mtune=i686   -DVERSION=\"804.027\" -DXS_VERSION=
    > > \"804.027\" -fPIC "-I/usr/lib/perl5/5.12.3/i486-linux-thread-multi/
    > > CORE"   -Wall -Wno-implicit-int -Wno-comment -Wno-unused -
    > > D__USE_FIXED_PROTOTYPES__ Xlib_f.c
    > > In file included from Xlib_f.c:8:0:
    > > Xlib.h:22:15: error: conflicting types for 'XKeycodeToKeysym'
    > > /usr/include/X11/Xlib.h:1694:15: note: previous declaration of
    > > 'XKeycodeToKeysym' was here
    > > make[1]: *** [Xlib_f.o] Error 1
    > > make[1]: Leaving directory `/home/miro/Downloads/Tk-804.027/pTk'
    > > make: *** [pTk/libpTk.a] Error 2
    > > I'm not exactly a Perl (or manual compilation) guru, can anyone tell
    > > me what I must do?

    >
    > It's not a Perl problem but might be a bug in the C code
    > of Tk, probably the one discussed here:
    >
    > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613188
    >
    > There's also a proposed patch by Dominique Dumont I append in full
    > at the end. It consists of inserting into 'perl-tk-804.029/pTk/Xlib.h'
    > (or 'perl-tk-804.027/pTk/Xlib.h' in your case) a line with
    >
    > #ifndef _X11_XLIB_H_
    >
    > before the line with
    >
    >  extern XFontStruct *XLoadQueryFont  _ANSI_ARGS_((Display *, const char *));
    >
    > and another line with
    >
    > #endif /* _X11_XLIB_H_ */
    >
    > after the line with
    >
    > extern int XSubtractRegion _ANSI_ARGS_((Region, Region, Region));
    >
    > I can't promise that this will really fix the problem but it
    > might be worth a try.
    >                                   Regards, Jens
    >
    > -----------------------8<------------------------------------
    > #! /bin/sh /usr/share/dpatch/dpatch-run
    > ## fix-ftbs.dpatch by Dominique Dumont <>
    > ##
    > ## All lines beginning with `## DP:' are a description of the patch.
    > ## DP: Added a test that protect against double inclusion with recent
    > ## DP: versions of Xlib.h provided by Xorg. The original test with X_LIB_H_
    > ## DP: was not changed to avoid breaking build when backporting perl-tk
    > ## DP: on older versions of Xorg.
    >
    > @DPATCH@
    > diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git'
    > '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr'
    > perl-tk-804.029~/pTk/Xlib.h perl-tk-804.029/pTk/Xlib.h
    > --- perl-tk-804.029~/pTk/Xlib.h 2007-02-10 09:55:23.000000000 +0100
    > +++ perl-tk-804.029/pTk/Xlib.h  2011-04-20 17:37:27.000000000 +0200
    > @@ -1,6 +1,7 @@
    >  #ifndef _XLIB
    >  #define _XLIB
    >  #ifndef _XLIB_H_
    > +#ifndef _X11_XLIB_H_
    >  extern XFontStruct *XLoadQueryFont  _ANSI_ARGS_((Display *, const char *));
    >  extern XModifierKeymap *XGetModifierMapping  _ANSI_ARGS_((Display *));
    >  extern XImage *XCreateImage  _ANSI_ARGS_((Display *, Visual *, unsigned int,
    >  int, int, char *, unsigned int, unsigned int, int, int));
    > @@ -143,6 +144,7 @@
    >  extern Window XGetSelectionOwner _ANSI_ARGS_((Display *, Atom));
    >  extern int XRectInRegion _ANSI_ARGS_((Region,int,int,unsigned,unsigned));
    >  extern int XSubtractRegion _ANSI_ARGS_((Region, Region, Region));
    > +#endif /* _X11_XLIB_H_ */
    >  #endif /* _XLIB_H_ */
    >  extern int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image));
    >  #endif /* _XLIB */
    > -----------------------8<------------------------------------
    >
    > --
    >   \   Jens Thoms Toerring  ___      
    >    \__________________________      http://toerring.de

    did ^:
    Wow. An unfixed bug that crippling in Tk? I thought it had been around
    since the dawn of time? Linus's Law shudders.
    Anywhoo, your patch worked great in that 'make' now took of without a
    hitch (even though I have no idea what the hack I just :^)
    I owe you and the community much gratitude.

    --Miro
    Miro, Oct 2, 2011
    #3
  4. Miro <> wrote:
    > Wow. An unfixed bug that crippling in Tk? I thought it had been around
    > since the dawn of time? Linus's Law shudders.


    Actually, as far as I understand the comments in the patch it's
    about a new version of XLib Tk wasn't yet tested against - and
    the guys taking care of the Tk stuff can't forsee everything
    that's going to happen to things they necessarily have to depend
    upon but have no influence over. If you closely look at the docu-
    mentation you might even find some information against what they
    tested and if you use something newer things can become "inter-
    esting"...

    > Anywhoo, your patch


    Not my patch, it was by Dominique Dumont <>,
    all I did was a tiny bit of google'ing;-)

    > worked great in that 'make' now took of without a hitch


    Fine;-)
    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
    Jens Thoms Toerring, Oct 2, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. linuxfreak

    wxPythin installation woes

    linuxfreak, Jul 21, 2005, in forum: Python
    Replies:
    3
    Views:
    266
    Florian Diesch
    Jul 22, 2005
  2. linuxfreak

    wxPythin installation woes

    linuxfreak, Jul 21, 2005, in forum: Python
    Replies:
    1
    Views:
    278
    Martin Franklin
    Jul 22, 2005
  3. linuxfreak

    wxPython installation woes on OpenSUSE

    linuxfreak, Jan 7, 2006, in forum: Python
    Replies:
    0
    Views:
    412
    linuxfreak
    Jan 7, 2006
  4. fedzor

    Ruby 1.9 Installation Woes

    fedzor, Jan 25, 2008, in forum: Ruby
    Replies:
    0
    Views:
    92
    fedzor
    Jan 25, 2008
  5. Tim McDaniel

    Re: magic installation woes [OT]

    Tim McDaniel, Aug 23, 2012, in forum: Perl Misc
    Replies:
    0
    Views:
    337
    Tim McDaniel
    Aug 23, 2012
Loading...

Share This Page