0

I am trying to compile some c++ source code I obtained from a client. I managed to include all the dynamic libraries and running g++ <args> -o bin/thin <path to main.cpp> yields the following output:

/usr/bin/ld: ./Libraries/Linux/ThinLayer/armv7l/libThinLayer.so.1.0.1: invalid string offset 1358 >= 183 for section `.strtab'
/usr/bin/ld: warning: libcrypto.so.1.0.0, needed by ./Libraries/Linux/ThinLayer/armv7l/libThinLayer.so.1.0.1, not found (try using -rpath or -rpath-link)

ldd bin/thin
    linux-vdso.so.1 (0xbea32000)
    /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6ebc000)
    libThinLayer.so.1 => /home/pi/G2KSDK4.1/Libraries/Linux/ThinLayer/armv7l/libThinLayer.so.1 (0xb6ea5000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6d5e000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6cdc000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6caf000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6b61000)
    libcrypto.so.1.0.0 => not found
    librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6b4a000)
    /lib/ld-linux-armhf.so.3 (0xb6ed1000)
    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6b20000)

So libcrypto.so.1.0.0 => not found shows that the library is missing. As far as I know until now, this library is part of the openssl package, and

ldconfig -p | grep -i libcrypto
    libcrypto.so.1.1 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1

shows that the package is actually installed.

Is it possible to compile the code using an older version of libcrypto without downgrading the whole package? I not, how can I downgrade this package?

0
libThinLayer.so.1.0.1: invalid string offset 1358 >= 183 for section `.strtab'

Is this something you built? Presumably not if it's the same thing that's linked to a non-existent lib. It may turn into a problem for you if you get everything built -- but it isn't the cause of this one. This is:

libcrypto.so.1.0.0 => not found
               ^^^
ldconfig -p | grep -i libcrypto
    libcrypto.so.1.1 (libc6,hard-float)
                 ^^^

The installed version is 1.1 whereas libThinLayer was linked to 1.0. You could try adding a symlink of 1.0.0 to 1.1 in an out of tree location, or copy it under the different name. You then need -L when building to get the linker to look in that location.

mkdir lib
ln -s /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1 lib/libcrypto.so.1.0.0
export LIBRARY_PATH=$PWD/lib/:$LIBRARY_PATH

You could just do it directly in /usr/lib/arm-linux... instead and run ldconfig but the other way seems a bit safer. This is part of openSSL.

Chances are that will work -- although the fact that a 1.0 symlink doesn't exist and that the .so was linked to 1.0.0 specifically implies some compatibility issue, it may also just be a quirk.

  • libThinLayer.so is part of the software I obtained from the client. I will try the idea the symlink, sound like a lovely hack :) – philipp Oct 14 at 20:55
  • I have tried to create a symlink and link it. So the compile error is gone, but trying to run the program yields the same error, that libcrypto.so.1.0.0 is missing. I would be really glad if you could provide an example about where to place the symlink and how to use g++. – philipp Oct 15 at 7:44
  • I've edited one in above. – goldilocks Oct 15 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.