Mac OS X运行KING工具出现dyld: __ZdaPvm符号缺失错误求助
Let's break down this error and walk through actionable fixes to get KING running properly.
First, the error dyld: Symbol not found: __ZdaPvm stems from a C++ standard library mismatch. The KING binary you’re using was compiled for Mac OS X 10.13, which relied on an older version of libstdc++.6.dylib. But modern Mac OS versions (like Big Sur and later) default to libc++ as the C++ standard library, creating a compatibility gap that triggers this linking error.
Here are the most reliable solutions:
Install GCC (with matching libstdc++) and run KING with the correct library path
Homebrew’s GCC package includes a compatiblelibstdc++that works with older binaries like your KING build:- Install GCC via Homebrew:
brew install gcc - Find the path to GCC’s
libstdc++(replace13with your installed GCC version—check withgcc --version):/usr/local/opt/gcc/lib/gcc/13/ - Run KING while pointing to this library path:
DYLD_LIBRARY_PATH=/usr/local/opt/gcc/lib/gcc/13 ./king -b ./ex/ex.bed
- Install GCC via Homebrew:
Recompile KING from source (most permanent fix)
Compiling KING directly on your system ensures it uses your Mac’s native C++ libraries, eliminating version mismatches entirely:- Download the KING source code from its official release repository.
- Unzip the source package and navigate to the directory in Terminal.
- Run the compile command (typically
make):make - Use the newly built
kingexecutable for your command—it should work without linking errors.
Temporarily adjust library loading priority (quick workaround)
If you have access to an older version oflibstdc++.6.dylib(from Mac OS X 10.13 or a compatible release), you can tell dyld to load it first:DYLD_FALLBACK_LIBRARY_PATH=/path/to/older/libstdc++ ./king -b ./ex/ex.bedNote: This is a temporary fix and might cause conflicts with other apps, so only use it for running KING specifically.
内容的提问来源于stack exchange,提问作者Carmen Sandoval

