[comp.sys.3b1] Problems with ISAM routines

wagner@cs.umn.edu (Paul J. Wagner) (04/23/91)

Hello,

I've got a 7300 running 3.51 Foundation Set, 3.5 Development Set, but
an old version of the ISAM routines (v.2.1).  I'm trying to write a
simple database application (create, add, delete, modify records, etc.),
but am having problems when I try linking in the ISAM routines.

The problem is that some of the ISAM routines are not being found.  I've
tried accessing 3 of them - CreateISAM, OpenISAM, and StoreISAMRecord -
the second is found, but the first and third are not.  I'm including
isam.h in my program header file (included in all source modules), and
link with libisam.a by:

	cc main.o a.o b.o ... z.o -g -o dbprog -lisam

Things I've tried/done:
- ran arconvert to bring libisam.a up to 5.2 archive format (needed to 
	do this anyway, but it didn't help this problem)
- tried confirming that a certain function/symbol is within the library 
	by using, e.g.,   dump -z OpenISAM libisam.a
   but dump wouldn't indicate that ANY routine (even ones such as OpenISAM
	that is being found at link time) was there.  (Dump *does* find
	my own functions in my own object files - am I missing something when I
	use it to search a library such as libisam.a?)
- I've also double-checked spellings and upper-case vs lower-case

I may be having a problem with the ISAM routines or it may be something
I'm missing generally re: using the libraries on the unix-pc.  Whatever,
if anyone has used the ISAM routines and/or could shed some light on this,
your thoughts would be greatly appreciated.

thanks,

Paul

	


-- 
* Paul J. Wagner                Internet - wagner@cs.umn.edu              *
* Computer Science Department   UUCP	 - ...!rutgers!umn-cs!wagner      *
* University of Minnesota       or, 120 S. Michigan, Eau Claire, WI 54703 *
*     "think globally, act lexically"                                     *

krohn@snowplow.bae.bellcore.com (Eric Krohn(C++)) (05/01/91)

In article <1991Apr22.212151.4564@cs.umn.edu>, wagner@cs.umn.edu (Paul J. Wagner) writes:
|> I've got a 7300 running 3.51 Foundation Set, 3.5 Development Set, but
|> an old version of the ISAM routines (v.2.1).  
|> 
|> The problem is that some of the ISAM routines are not being found.  I've
|> tried accessing 3 of them - CreateISAM, OpenISAM, and StoreISAMRecord -
|> the second is found, but the first and third are not.  

It sounds like the ISAM library was compiled on a pre-3.5 Development Set.
If so, the symbol names got truncated to seven or eight characters,
but your 3.5 compiler is not truncating the names (so called flexnames).
Thus any long name you call in your code will not match the same name in
the old library, because only the first part of the name is in the library.

I think the 3.5 ld command has a -T option to truncate the names, giving
you backward compatibility with old libraries.

-- 
Eric Krohn	krohn@bae.bellcore.com	or	uunet!bellcore!bcr!krohn

wagner@cs.umn.edu (Paul J. Wagner) (05/01/91)

In article <1991Apr30.200606.1386@bellcore.bellcore.com> krohn@bae.bellcore.com writes:
>In article <1991Apr22.212151.4564@cs.umn.edu>, wagner@cs.umn.edu (Paul J. Wagner) writes:
>|> The problem is that some of the ISAM routines are not being found....  
...

>It sounds like the ISAM library was compiled on a pre-3.5 Development Set.
... < thus truncating all symbol names to 8 characters > ...

This was indeed my problem, as several folks kindly pointed out.  Thanks
to everyone who took the time to respond - this group rates high on the
helpfulness scale.

>
>I think the 3.5 ld command has a -T option to truncate the names, giving
>you backward compatibility with old libraries.
>

This was the most popular suggestion for a solution (I've tried this and
it does indeed work for my application), though *all* symbol names are
truncated.

Kris Kugel suggested that the -G flag is even better, as the loader
re-searches the modules for the unresolved symbols, after truncating *only*
those unresolved symbols (making it less likely that you'll get a symbol
name conflict due to having multiple symbols starting with the same 8
characters).  Makes sense to me...

thanks again for all suggestions/solutions,

Paul
-- 
* Paul J. Wagner                Internet - wagner@cs.umn.edu              *
* Computer Science Department   Work     - pwagner@uwstout.edu            *
* University of Minnesota       or, 120 S. Michigan, Eau Claire, WI 54703 *
*     "think globally, act lexically"                                     *