I found the reason: I manually linked a so file in ClangSharpPInvokeGenerator 's appopriate folder, which is suggested by the ClangSharpPInvokeGenerator document on github.