[cfe-dev] Loading clang example plugin error (Symbol not found: __ZN5clang11ASTConsumer21HandleInterestingDeclENS_12DeclGroupRefE)

PavelKatunin wk.katunin at gmail.com
Thu Nov 21 04:34:31 PST 2013


there is related post 
http://stackoverflow.com/questions/20116475/how-can-i-specify-additional-clang-options-for-xcode-project
<http://stackoverflow.com/questions/20116475/how-can-i-specify-additional-clang-options-for-xcode-project>  

I have build example from clang sources (libPrintFunctionNames.dylib), 
and I am trying to load plugin with xcode project, 
but there is error:

error: unable to load plugin
'/Users/...llvm/Debug+Asserts/lib/libPrintFunctionNames.dylib':
'dlopen(/Users/.../llvm/Debug+Asserts/lib/libPrintFunctionNames.dylib, 9):
Symbol not found:
__ZN5clang11ASTConsumer21HandleInterestingDeclENS_12DeclGroupRefE Referenced
from: /Users/.../llvm/Debug+Asserts/lib/libPrintFunctionNames.dylib Expected
in: flat namespace in
/Users/.../llvm/Debug+Asserts/lib/libPrintFunctionNames.dylib' Command
/Applications/Xcode
2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
failed with exit code 1

I have tried to use libPrintFunctionNames.a instead of
libPrintFunctionNames.dylib, but it did not help me.
What am I doing wrong?

Also I have some questions:

1. If I use clang::Rewriter class for changing sources, but don't use
overwriteChangedFiles() method in plugin.
Would my changes be applied in that compilation action? Or I should call
overwriteChangedFiles()?
I do not want make permanent changes on source code.

2. I would like to save all commands generated by Xcode, because it is
difficult to create and pass those commands for every Xcode project. 
That is the reason why I choose to use clang plugin but not clang tool. 
My clang plugin is run as a completely new instance for each source file,
but I need to pass some common information from source to source (I need to
divide classes from standard frameworks and Classes
 from project, to apply my changes only on classes that belong to my
project).
 How can I do achieve this?
To divide classes from standard frameworks and Classes from project, 
or to pass some common information from plugin instance to plugin instance.

Thank you! Sorry for my English.




--
View this message in context: http://clang-developers.42468.n3.nabble.com/Loading-clang-example-plugin-error-Symbol-not-found-ZN5clang11ASTConsumer21HandleInterestingDeclENS--tp4036227.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list