Home > other >  Linux - an error occurred when loading Shared libraries: internal error
Linux - an error occurred when loading Shared libraries: internal error

Time:01-05

I in this guide after cross-compilation OpenCV for arm, and set up the sample program.
When I first run like this:

./the DisplayImage image. PNG

I have:


./the DisplayImage: error while loading Shared libraries:
Libopencv_highgui. So. 3.1: always open a Shared object file: No to the file or directory

So I think it need library libopencv_highgui. So. 3.1. So I add all these libraries to the/lib:

(1) libopencv_highgui. So
(2) libopencv_highgui. So.
3.1(3) libopencv_highgui. So. 3.1.0

A symbolic link: (1) - & gt; (2) - & gt; (3)
But now I got:


./the DisplayImage: error while loading Shared libraries:
Lib/libopencv_highgui. So. 3.1: internal error

I run on libraries and executable file to check their information, this is the output:

. Opencv/platforms/Linux/my_build/lib/$file libopencv_highgui. So. 3.1.0
Libopencv_highgui. So. 3.1.0: ELF 32 - bit LSB Shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID [sha1]=1107 ba22b36437bedb37dbfe0250626c14759be9, not stripped

./opencv_sample $file the DisplayImage
The DisplayImage: ELF 32 - bit LSB executable that ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter/lib/ld - Linux. So. 3, for the GNU/Linux 3.2.0, BuildID [sha1]=aef57fe79d0928ca3afdff8d1b65268e1ad72e77, not stripped

Editor: run the DisplayImage readelf - d | grep men:

0 x00000001 (men) Shared library: [3.1] libopencv_highgui. So.
0 x00000001 (men) Shared library: [3.1] libopencv_imgcodecs. So.
0 x00000001 (men) Shared library: [3.1] libopencv_core. So.
0 x00000001 (men) Shared library: [6] libstdc++. So.
0 x00000001 (men) Shared library: [1] libgcc_s. So.
0 x00000001 (men) Shared library: [6] libc. So.
0 x00000001 (men) Shared library: [ld - Linux - armhf. So. 3)

In addition to ld - Linux - armhf. So. 3, I found them on my goal.
What may cause the "internal error" problem?

CodePudding user response:

When compiled binary files, it can use a Shared library, the library is the reference with the version number, so that you get the supported library version.
Sometimes you can be a relatively new libary by sym link to one of my old name, will try to use the binary file.
But this does not mean that the binary file will support this version. Some features may have changed, some functionality has been deleted or added, and so on.
Therefore, I suggest for newer versions of libary recompiling binaries, will mark incompatibility at compile time.
You can use the LDD view library dependencies.
Cases;

LDD $/bin/ls
Linux - vdso. So. 1 (0 x00007ffc65ff3000)
Libselinux. So. 1=& gt;/lib/x86_64 - - the gnu/Linux libselinux. So. 1 (0 x00007f9033f91000)
6=& gt; libc. So./lib/x86_64 - - the gnu/Linux libc. So. 6 (0 x00007f9033bf1000)
3=& gt; libpcre. So./lib/x86_64 - - the gnu/Linux libpcre. So. 3 (0 x00007f9033979000)
Libdl. So. 2=& gt;/lib/x86_64 - - the gnu/Linux libdl. So. 2 (0 x00007f9033771000)
/lib64/ld - Linux - x86-64. So. 2 (0 x0000558f25845000)
Libpthreads. So. 0=& gt;/lib/x86_64 - - the gnu/Linux libpthreads. So. 0 (0 x00007f9033551000)

Editor: ps... You can't just copy the libs, because they have their own dependencies. Your cross-compilation machine needs similar to compile the lib version.

CodePudding user response:

I also encountered similar problems, there is no solution,
Questions as follows:
Use OpenCL libraries, from ARM's official website, is suitable for the 32 bit armv7 Mali - T628; ARM of the library is not open source, provides the binary so, roughly there are two kinds of version "fbdev" and "x11", what is the difference between not clear; But try download have the same problem,
An error is:
Error while loading Shared libraries:/lib/libOpenCL. So: internal error

I did not call any OpenCL interface in the test program code, just to test - l OpenCL
Compilation is no problem, the problem should be out in the loading libOpenCL. So time,

But now I don't know why internal error...

Do not know to have bosses explain ah,,,
  • Related