But building these modules can be a pain, if don't know about the right dependencies like libxt-dev and libxtst-dev .
# Build Fails
cp GUITest.pm blib/lib/X11/GUITest.pm /usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap /usr/share/perl/5.8/ExtUtils/typemap -typemap typemap GUITest.xs > GUITest.xsc && mv GUITest.xsc GUITest.c cc -c -I/usr/X11R6/include -I/usr/X/include -Wall -O2 -DVERSION=\"0.21\" -DXS_VERSION=\"0.21\" -fPIC "-I/usr/lib/perl/5.8/CORE" -DNDEBUG -DX11_GUITEST_ALT_L_FALLBACK_META_L GUITest.c GUITest.xs:41:27: error: X11/Intrinsic.h: No such file or directory GUITest.xs:42:28: error: X11/StringDefs.h: No such file or directory make: *** [GUITest.o] Error 1
root@arky-laptop:~/.cpan/build/X11-GUITest-0.21-4tUEBB# less README root@arky-laptop:~/.cpan/build/X11-GUITest-0.21-4tUEBB# make cc -c -I/usr/X11R6/include -I/usr/X/include -Wall -O2 -DVERSION=\"0.21\" -DXS_VERSION=\"0.21\" -fPIC "-I/usr/lib/perl/5.8/CORE" -DNDEBUG -DX11_GUITEST_ALT_L_FALLBACK_META_L GUITest.c GUITest.xs:41:27: error: X11/Intrinsic.h: No such file or directory GUITest.xs:42:28: error: X11/StringDefs.h: No such file or directory
make: *** [GUITest.o] Error 1
# found libxt-dev provides the needed header files
/usr/include/X11/Intrinsic.h libxt-dev /usr/include/X11/StringDefs.h libxt-dev
# install the libxt-dev
$ sudo apt-get install libxt-dev
[sudo] password for arky:
Reading package lists... Done
Building dependency tree
Reading state information...
Done
The following NEW packages will be installed: libxt-dev 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 482kB of archives. After this operation, 1319kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com hardy/main libxt-dev 1:1.0.5-3 [482kB] Fetched 482kB in 44s(10.9kB/s)
Selecting previously deselected package libxt-dev. (Reading database ... 145581 files and directories currently installed.) Unpacking libxt-dev (from .../libxt-dev_1%3a1.0.5-3_i386.deb) ... Setting up libxt-dev (1:1.0.5-3) ...
## Second built error
LD_RUN_PATH="/usr/lib" cc -shared -L/usr/local/lib GUITest.o -o blib/arch/auto/X11/GUITest/GUITest.so \ -lXtst -lXext -lX11 \ /usr/bin/ld: cannot find -lXtst collect2: ld returned 1 exit status # the shared object is provided by libxtst-dev /usr/lib/libXtst.so libxtst-dev
# Install the libxtst-dev
$ sudo apt-get install libxtst-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed: x11proto-record-dev The following NEW packages will be installed: libxtst-dev x11proto-record-dev 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.8kB of archives. After this operation, 156kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://in.archive.ubuntu.com hardy/main x11proto-record-dev 1.13.2-4ubuntu1 [6022B]
Get:2 http://in.archive.ubuntu.com hardy/main libxtst-dev 2:1.0.3-1 [14.8kB] Fetched 20.8kB in 21s (964B/s)
Selecting previously deselected package x11proto-record-dev. (Reading database ... 145890 files and directories currently installed.)
Unpacking x11proto-record-dev (from .../x11proto-record-dev_1.13.2-4ubuntu1_all.deb) ...
Selecting previously deselected package libxtst-dev.
Unpacking libxtst-dev (from .../libxtst-dev_2%3a1.0.3-1_i386.deb) ...
Setting up x11proto-record-dev (1.13.2-4ubuntu1) ...
Setting up libxtst-dev (2:1.0.3-1) ...
2012 and this is still useful the CPAN page needs to list these 2 dependencies! took me so long to figure out why I was having build errors you are a savior thank you! Now I'm automating stuff left and right in linux like i was with autohotkey in windows THANKS!
ReplyDeleteGlad this snippet helped.
ReplyDeleteDo you want to fix this bug ? This is how you fix CPAN bugs? http://stackoverflow.com/questions/7244761/how-to-report-a-cpan-module-bug
Filed a bug on CPAN. Let us see what the maintainer has to say about this issue.
ReplyDeletehttps://rt.cpan.org/Public/Bug/Display.html?id=75728