shan_emails has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

While i try to installing the Perl Module Tk. i got the following error message. I don't have root access so i installing into my home directory with PREFIX option.

And i followed the steps by README.linux, But while installing X11 Module it shows below error

bash-3.2$ pwd /xx/xx/.cpan/build/X11-Xlib-0.02 bash-3.2$ perl Makefile.PL PREFIX=/xx/others Can't link/include 'X11/Xlib.h', 'X11/Xutil.h', 'X11'

And i con't find these file and don't know how to proceed futher.
Anyhelp will be grate!

Thanks,

Replies are listed 'Best First'.
Re: install Perl Module Tk in Linux RedHatOS
by aitap (Curate) on Jun 12, 2013 at 17:18 UTC

    You need the X11 library header files, which are provided in the package separate from the one providing /usr/lib64/libX11.so, with "-devel" at the end of the name. Probably it's called "xorg-x11-devel" or "libX11-devel".

    Since you are not root, download this package (manually from a mirror site, or using yum install xorg-x11-devel -y --downloadonly --downloaddir=., if "downloadonly" YUM plugin is installed), extract it somewhere (rpm2cpio file.rpm | cpio -idmv) and append the path to <extracted rpm root>/usr/include to the Makefile.PL parameters, like this:

    $ cpan cpan[1]> look Tk $ perl Makefile.PL INC="-I/home/username/xorg-x11-devel-extracted/usr/ +include" <other parameters, if needed> (check if Makefile was successfully generated) $ make $ make test $ make install $ exit cpan[2]> exit $

    If Makefile.PL asks you for some other library which is not installed on the system, you'll have to build it, then install somewhere you have write access to, then add another -I<somewhere> to INC and -L<directory/where/*.so/are/present> to LIBS (read ExtUtils::MakeMaker for more information on this topic).

    It's probably easier to ask the administrator to install perl-Tk RPM package.

Re: install Perl Module Tk in Linux RedHatOS
by marto (Cardinal) on Jun 12, 2013 at 16:31 UTC

    As mentioned here you should stop messing with the system perl and install your own elsewhere.

    "You probably need to install the X11 development package first. On Debian Linux, these are the packages libx11-dev and x-dev."

    These aren't the perl X11-Xlib module you're trying to install. The documentation tells you what these are called under Debian, if you're running Redhat check their package management tool, they may have a different name.

      Hi,

      I am using the RedHat server version, so
      Shall i know where to check the name in Package management tool. Can you little brief.

      bash-3.2$ uname -a Linux weblt0001 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 + x86_64 x86_64 x86_64 GNU/Linux
      Thanks,
      Shanmugam A.

Re: install Perl Module Tk in Linux RedHatOS
by hbm (Hermit) on Jun 12, 2013 at 16:32 UTC

    I haven't been down this particular road, but it sounds like X11::Xlib is a light wrapper around libx11-dev and x-dev. Did you install those libraries yet?