Undefined symbol error from plugin loading

I have clang-12 and installed the llvm12 from the source code.

llvm-config --version # 13.0.0git

Using this command:

clang-12 -Xclang -load -Xclang /home/llvm-project/build/lib/myplugin.so example.c

Outputs error, undefined symbol

error: unable to load plugin '/home/llvm-project/build/lib/myplugin.so': '/home/llvm-project/build/lib/myplugin.so: undefined symbol: _ZN4llvm23EnableABIBreakingChecksE'

I googled about this symbol problem but I didn’t find proper solution. How can I fix this…?
Thank you


This happens when you build your plugins with assertions enabled, but clang was built in release mode (without assertions). These build settings needs to match and the error is a safety mechanisms to catch this.

1 Like