Results 1 to 2 of 2

Thread: Linked shared lib disappearing

  1. #1

    Default Linked shared lib disappearing


    I'm trying to link a shared lib ( ) into the executables of a package ( ). Everything seems to work OK, i. e. the package builds successfully. However, when I install the result and examine the executables with "ldd", libsyncdir is not listed and the build log doesn't list libsyncdir in Requires. (libsyncdir provides only symbols that are also in libc.)

    Building the package locally (openSUSE 11.4) from the same spec file produces the expected result, i. e. ldd lists libsyncdir and Requires also contains it.

    Strangely, according to the build logs from OBS it works OK for SLE_11_SP1 but doesn't for openSUSE-11.3, 11.4 and Factory.

    Any ideas?


  2. #2

    Default Re: Linked shared lib disappearing

    Found it. I was linking with "gcc ... -lsyncdir file.o -o file", but in newer openSUSE versions the order of arguments during linking matters. I. e. libsyncdir is only looked at if files listed before -lsyncdir use symbols from it. Moving -lsyncdir to the end of the argument list fixed the problem.

    (I'd been bitten by this before, but then linking failed - in this case it worked because libsyncdir contains only symbols also present in libc.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts