Mailinglist Archive: opensuse-packaging (206 mails)

< Previous Next >
Re: [opensuse-packaging] Help with stupid link error
  • From: Cristian Morales Vega <cmorve69@xxxxxxxx>
  • Date: Wed, 26 Jan 2011 22:10:56 +0100
  • Message-id: <>
2011/1/26 Robert Schweikert <rschweikert@xxxxxxxxxx>:

Working on packaging OpenStack as part of my Hackweek 6 endeavor. Nova
(one part of OpenStack) needs a newer version of redis than is available
in OBS, thus I am sticking a copy into Virtualization:Cloud:OpenStack
for now.

I have run into a stupid link error that makes no sense to me, thus help
is much appreciated.

/usr/src/packages/BUILD/redis-2.0.4/redis.c:9293: undefined reference to

The math library is on the link line:

cc -o redis-server -std=c99 -pedantic -O2 -Wall -W
-fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -lm
-pthread  -fomit-frame-pointer -fmessage-length=0 -O2 -Wall
-D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables
-fasynchronous-unwind-tables -g -rdynamic -ggdb  adlist.o ae.o anet.o
dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o

...but in the wrong place.

Because of this:
and /etc/profile.d/ from post-build-checks

The man from ld applies:

-l namespec
Add the archive or object file specified by namespec to the
list of files to link. This option may be used any number of times.
If namespec
is of the form :filename, ld will search the library path
for a file called filename, otherwise it will search the library path
for a file
called libnamespec.a.

On systems which support shared libraries, ld may also
search for files other than libnamespec.a. Specifically, on ELF and
SunOS systems, ld
will search a directory for a library called
before searching for one called libnamespec.a. (By convention, a
".so" extension
indicates a shared library.) Note that this behavior does
not apply to :filename, which always specifies a file called filename.

********The linker will search an archive only once, at the
location where it is specified on the command line********. If the
archive defines a symbol
which was undefined in some object which appeared before
the archive on the command line, the linker will include the
appropriate file(s)
from the archive. However, an undefined symbol in an
object appearing later on the command line will not cause the linker
to search the
archive again.

Usually caused because of a confusion between _LIBADD/_LDADD and
_LDFLAGS in automake:
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups