cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with "less" command

SOLVED
Go to solution
shmo982
Occasional Contributor

Issue with "less" command

Hello all,

I'm running into an issue w/one of my servers while trying to run the less command.
#less
/usr/lib/hpux32/dld.so: Unable to find library 'libtermcap.so'.
Killed

This a new server and I don't think the less command has been compiled correctly. So I downloaded the tar file and attempted to install it.... Here's what i ran into

#sh configure // everything runs well here
..................
........

checking for regcmp... yes
using regcmp
updating cache ./config.cache
creating ./config.status
creating Makefile
creating defines.h


#he4 #make install // I get errors, go down
test ! -f stamp-h || CONFIG_FILES= CONFIG_HEADERS=defines.h ./config.status
touch stamp-h
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 main.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 screen.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 brac.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 ch.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 charset.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 cmdbuf.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 command.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 decode.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 edit.c
gcc -I. -c -DBINDIR=\"/usr/local/bin\" -DSYSDIR=\"/usr/local/etc\" -g -O2 filename.c
In file included from /usr/include/sys/stat.h:36,
from filename.c:41:
/usr/include/sys/_stat_body.h:63: error: parse error before "blksize_t"
/usr/include/sys/_stat_body.h:66: error: parse error before ':' token
/usr/include/sys/_stat_body.h:68: error: parse error before ':' token
/usr/include/sys/_stat_body.h:69: error: parse error before ':' token
/usr/include/sys/_stat_body.h:70: error: parse error before ':' token
/usr/include/sys/_stat_body.h:88: error: parse error before '}' token
filename.c: In function `is_dir':
filename.c:925: error: storage size of 'statbuf' isn't known
filename.c: In function `bad_file':
filename.c:970: error: storage size of 'statbuf' isn't known
filename.c: In function `filesize':
filename.c:1002: error: storage size of 'statbuf' isn't known
*** Error exit code 1

What do you think??
5 REPLIES
Matti_Kurkela
Honored Contributor
Solution

Re: Issue with "less" command

Where did you load the source code?

The HP-UX Porting and Archive Centre, has ready-made .depots for supported HP-UX versions and pre-modified source code for compiling on older, unsupported versions:
http://hpux.connect.org.uk/

When installing depots from the Porting Archive, you should pay attention to the "Run-Time Dependencies" field on the package page. Before installing the package, you should make sure that all the run-time dependency packages are also installed, or the program most likely won't run. Note that the dependency packages themselves may have their own dependencies, and so on...

By the way, your original error message (Unable to find library 'libtermcap.so') looks exactly like what happens if run-time dependencies are ignored.

If you have to compile from the Porting Archive's sources, pay attention to "Build-time Dependencies", respectively.

If you get the original source from the author's website (in this case, http://www.greenwoodsoftware.com/less/download.html ), this does not free you from build-time dependencies: instead, you must read the READMEs and other documentation files included in the source package to find out what the dependencies are, and then figure out yourself how to fulfill them.

MK
MK
Steven Schweda
Honored Contributor

Re: Issue with "less" command

> This a new server and I don't think the
> less command has been compiled correctly.

The same may be true about GCC. It's not
unusual for a defective GCC installation to
cause complaints about the system header
files (like, say,
"/usr/include/sys/_stat_body.h").

Potentially useful info (as always):
uname -a
gcc --version (or -V?)
Dennis Handly
Acclaimed Contributor

Re: Issue with "less" command

>Steven: It's not unusual for a defective GCC installation to cause complaints about the system header files

Right. You also might want to look at the lines in error for some evil macro.
shmo982
Occasional Contributor

Re: Issue with "less" command

I was missing a library, it's working fine now that it's installed.. Thank you all for you help... 10 points for all

Re: Issue with "less" command

try ldd `which less` and identify library not found.

This output my machine:

#ldd `which less`
=>
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libgen.2 => /usr/lib/libgen.2
#

Regards,

Michael Schon