[Techtalk] Trying to get octave to compile.

John Clarke johnc+linuxchix at kirriwa.net
Thu Mar 18 10:55:04 EST 2004


On Thu, Mar 18, 2004 at 12:18:35 +1100, Sue Stones wrote:

> I have readline-4.3-4 it includes these lines as in yours.

Where is readline.h?  Mine's in /usr/include/readline.

> > Does oct-rl-edit.c include readline.h, and if so, and if you have
> > multiple copies of readline.h, do they all define these symbols?
> 
> oct-rl-edit.c contains the line
> 
> #include <readline/readline.h>

The compiler tries each directory in the include path to find each file.
The first one found is used.  These are the standard include
directories, others are added with '-I' on the command line:

    /usr/lib/gcc-lib/i386-redhat-linux/2.96/include
    /usr/include
    /usr/local/include
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../../i386-redhat-linux/include
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/include
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../../include/g++-3

The version number (2.96) and target directory (i386-redhat-linux) may
be different on your machine.  I don't think there's an option to tell
gcc or cpp to print the standard include directories, so I found them
with:

    strings /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0|grep include

Another way to work out if it's including the file you expect is to put
a #error directive at the beginning of the file.  If the compiler
doesn't spit out the error message, it's not including that file.

If you run updatedb each night (probably have a daily cron job in
/etc/cron.daily or /etc/crontab) you should be able to use 'locate
readline.h' to find all copies of readline.h.

> I suspect that my readline. is in the wong place.  Can you tell me what 
> should be where?  Where should I be installing things from.  

On my RH7.3 systems, the readline libraries are in /usr/lib and headers
in /usr/include/readline.  Later you say that you have a readline rpm
installed, so you don't need to install readline manually.  You just
need to install the readline-devel rpm to get the headers.

> [sue at localhost lib]$ ls /lib/libread*
> /lib/libreadline.so@    /lib/libreadline.so.4.1@  /lib/libreadline.so.4.3
> /lib/libreadline.so.4@  /lib/libreadline.so.4.2@
> [sue at localhost lib]$ nm libreadline.so | grep -w 'rl_terminal_name'
> nm: libreadline.so: no symbols

Is libreadline.so an empty or nearly empty file?  I'd suggest you
delete the version of readline that you built yourself and install the 

If you have more than one libreadline.so (e.g. one in /lib and one in
/usr/lib), you can find out which one that gcc will use with 'gcc
--print-search-dirs'.  '-L' and '-B' on the command line add
directories to this list.


Cheers,

John
-- 
Although I have to admit that I'd be a bit dubious about some random person 
sending me love letters.  I don't think I've *ever* received such a thing
-- the note saying `keep away from me -- I've heard all about you...' I
received when I was 14 doesn't really count.              -- Matt McLeod


More information about the Techtalk mailing list