SUMMARY: (INCONCLUSIVE) Linking problems on T64 UNIX 4.0F

From: Nikola Milutinovic <Nikola.Milutinovic_at_ev.co.yu>
Date: Tue, 29 Aug 2000 08:42:20 +0200

Hi folks.

I still haven't solved the problem, but have got a couple of responses.
Thanks to:

Tim Mooney <mooney_at_dogbert.cc.ndsu.NoDak.edu>
Frank Wortner <frank_at_bondnet.com>
Sleepycat Software Support <support_at_sleepycat.com>

People sugested that replacing original sh_libs is a bad idea. I have
verified that, IT IS A BAD IDEA. libsecurity.so depends on libdb.so and
when I removed that, I couldn't login.

All of them sugested I use -oldstyle_liblookup while linking. It didn't
help. Here is what it boild down to:

test.c
----------------
int db_create();

int main() {
  db_create();
  return 0;
  }
----------------

/usr/shlib/libdb.so original DEC's (v1.85, AFAIK)
/usr/local/lib/libdb.so -> libdb-3.0.so
/usr/local/lib/libdb-3.so -> libdb-3.0.so
/usr/local/lib/libdb-3.0.so

Now, the problem parts:

# cc -c -shared test.c

# ld -oldstyle_liblookup -L/usr/local/lib -ldb -o test.exe test.o
ld:
Error: Undefined:
db_create

# ld -oldstyle_liblookup -L -L/usr/local/lib -ldb -o test.exe test.o
ld:
Error: Undefined:
db_create

# ld -oldstyle_liblookup -L -L/usr/local/lib -ldb-3 -o test.exe test.o
ld:
Can't locate file for: -ldb-3

# ld -oldstyle_liblookup -L -L/usr/local/lib -ldb-3.0 -o test.exe test.o
ld:
Can't locate file for: -ldb-3.0

I have no idea for either of these errors. It should link against "-ldb"
and it should be able to locate file for "ldb-3".

Now, this fails, but I expect it:

# cc -ldb test.c -o proba.exe
ld:
Unresolved:
db_create

It is linking against default lib (v1.85). Now, get a load of this:

# cc -L/usr/local/lib -ldb test.c -o proba.exe
# odump -Dl proba.exe


                        ***LIBRARY LIST SECTION***
        Name Time-Stamp CheckSum Flags Version
proba.exe:
        libdb-3.0.so Aug 24 14:01:34 2000 0x2e3bea79 0
        libc.so Feb 24 22:19:15 2000 0xbad758ae 0 osf.1

IT LINKS AS IT SHOULD! Using "-ldb-3" or "-ldb-3.0" also works.

Can anyone shed some light on this? As far as I can tell, "ld" is very,
very picky and sensitive about command line arguments. Am I doing
something wrong here?

Nix.
-- 
Get your hand out of my panties,.... I'm counting to 1000!
Received on Tue Aug 29 2000 - 06:41:24 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT