Rate This Document
Findability
Accuracy
Completeness
Readability

"undefined symbol: __res_nsearch" Displayed During BE Compilation

Symptom

When the STRIP_DEBUG_INFO=ON sh build.sh --clean --be command is executed, the error message "undefined symbol: __res_nsearch" is displayed.

Key Process and Cause Analysis

The pre-downloaded libkrb5.a file from the third-party needs to be recompiled.

Conclusion and Solution

  1. Recompile the third-party libkrb5.a file.
    1. Open the file.
      1
      vi /opt/tools/installed/doris-2.1.2-rc04/thirdparty/build-thirdparty.sh
      
    2. Comment out line 1871, add line 1872 to add the packages parameter, and set packages to krb5.
      1
      packages=(krb5)
      

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  2. Use GCC 12 to compile the third-party krb5.
    1
    2
    3
    export DORIS_TOOLCHAIN=gcc
    cd /opt/tools/installed/doris-2.1.2-rc04/thirdparty
    sh build-thirdparty.sh
    
  3. Run the command again:
    1
    2
    3
    export DORIS_TOOLCHAIN=clang
    cd /opt/tools/installed/doris-2.1.2-rc04
    STRIP_DEBUG_INFO=ON sh build.sh --clean --be