<div class="__aliyun_email_body_block"><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">Hello, Everyone!<br></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><hr></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">Recently, I am leanring how to write a Clang plugin. I begin with the plugin PrintFunctionsNames. PrintFunctionsName is issued with Clang(locating in CLANG_SOURCE_PATH/examples/PrintFunctionNames), and is used for an exmple to illustrate how to write a plugin for Clang.<br></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><hr></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">I use command "make" to generate libPrintFunctionNames.so and libPrintFunctionNames.a, then use the command "clang ./hello.c -Xclang -load -Xclang LLVM_BUILD_PATH/Release+Asserts/lib/libPrintFunctionNames.so -Xclang -plugin -Xclang print-fns" to test the plugin on ./hello.c, which is a simple helloworld program.<br></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><hr></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">But I get an error, which is <br></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">"/usr/bin/ld: cannot find /tmp/hello-xxxxxx.o: No such file or directory</div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">clang: error: linker command failed with exit code 1 (use -v to see invocation)".<br></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><hr></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">Howevery, if I use the command "clang ./hello.c <span style="color: #ff0000;"><strong>-E</strong></span> -Xclang -load -Xclang LLVM_BUILD_PATH/Release+Asserts/lib/libPrintFunctionNames.so -Xclang -plugin -Xclang print-fns", PrintFunctionNames works well.<br></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><hr></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">So I want to know why I cannot use clang to generate a executable file for ./hello.c when the plugin PrintFunctionNames is enabled?<br></div></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;"><hr></div><div style="color: #333333;font-size: 14.0px;font-family: tahoma , arial , stheiti , simsun;">Any help is appreciated!</div></div><div class="__aliyun_signature_wrap"><br><br></div></div>