我要评分
获取效率
正确性
完整性
易理解

Library Files Not Found When Replacing a Dynamic Library with a Static Library

Symptom

An error is reported when compiling Snappy-java:

1
[exec] make: *** [target/commons-crypto-1.0.0-Default/libcommons-crypto.so] Error 1

Key Process and Cause Analysis

None

Conclusion and Solution

  • Solution 1:
    1. Go to the commons-crypto-CRYPTO-1.0.0 directory.
      1
      cd commons-crypto-CRYPTO-1.0.0
      
    2. Add the -Wl,-Bdynamic compilation option of G++ to the Makefile file.
  • Solution 2:

    If you replace the static library with a dynamic library, the library may not be found during the running. You can install the corresponding static library to solve the problem.

    Use the yum source to install the required glibc and libstdc++-static.
    1
    2
    yum install libstdc++-static.aarch64 -y
    yum install glibc* -y