Error when loading libraries using 'opt -load' command

Hi,

I have managed to install LLVM on my system following the documentation given on the site. But I am facing issues when trying to run some of the example transforms which are distributed as part of the installation.

Below is the error message :

Error opening ‘/home/sandy/llvm/src/Debug/lib/LLVMHello.so’: /home/sandy/llvm/src/Debug/lib/LLVMHello.so: undefined symbol: _ZNK4llvm12FunctionPass17createPrinterPassERNS_11raw_ostreamERKSs
-load request ignored.
opt: Unknown command line argument ‘-Hello’. Try: ‘opt -help’

I get the same error message when I try to load any of the generated shared objects (FunctionPass in the error message becomes ModulePass as is defined in the code).
I have tried installing llvm multiple times but it has not helped.

Please help me fix this.

Regards,
Sandeep