解释一下,大概就是试图静态链接自己编译的 libncurses(和 pkgsrc 在 /opt/pkg/lib 下的 libncurses)失败。
原因我猜测是 XCode 装的 clang 会先去 SDKROOT 下找这个 tbd 文件,然后发现在我自己编译的 libncurses 里找不到相应的 versioned symbol。
然后我有试过 export SDKROOT=/nonesuch,但是这样连 clang 都跑不起来了:
jing@rne Downloads % export SDKROOT=.
jing@rne Downloads % clang a.c -I/usr/local/include -L/usr/local/lib -lncurses -Wl,-search_paths_first
2025-11-29 20:45:57.688 xcodebuild[4920:10295798] Writing error result bundle to /var/folders/15/9ywh0fzd4x11sblgmg_yj6sw0000gn/T/ResultBundle_2025-29-11_20-45-0057.xcresult
xcodebuild: error: SDK "." cannot be located.
clang: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk . -find clang 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'clang', requesting installation of command line developer tools.
关于 tbd 是什么:tapi-tbdv5(1) (或者 man tapi-tbd
