Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Feb 2009 14:01:41 +0300
From:      pluknet <pluknet@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   linking .a lib with another library
Message-ID:  <a31046fc0902050301k44955c40lf0cd379a376ee7e5@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi.

The problem is:

I have a program which is statically linked to my static lib during a build.
The lib is in turn uses kvm*() calls, hence it should be linked with libkvm.

During the build of my binaries which are linked to my libucron.a I
get the following:

/usr/home/pluknet/svn/ucron/ksucron/crond/../lib/libucron.a(misc.o)(.text+0x6e):
In function `check_pidfile':
: undefined reference to `kvm_open'
/usr/home/pluknet/svn/ucron/ksucron/crond/../lib/libucron.a(misc.o)(.text+0x8b):
In function `check_pidfile':
: undefined reference to `kvm_getprocs'
/usr/home/pluknet/svn/ucron/ksucron/crond/../lib/libucron.a(misc.o)(.text+0xbe):
In function `check_pidfile':
: undefined reference to `kvm_getprocs'
/usr/home/pluknet/svn/ucron/ksucron/crond/../lib/libucron.a(misc.o)(.text+0x106):
In function `check_pidfile':
: undefined reference to `kvm_close'
*** Error code 1

Ok, if I add SHLIB_MAJOR directive in lib/Makefile (or remove any kvm*
references) then all is ok.
But the lib is used to be static. So the question is can I somehow
link two .a libraries?
e.g. libkvm.a + libucron.a + my binaries.

Thanks.

-- 
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a31046fc0902050301k44955c40lf0cd379a376ee7e5>