Hi guys,<br>
<br>
I am developing a LLVM project and using LLVM building system to make
an opt pass. I find that if I implement class methods in seperate .cpp
files(the class declaration is included by all .cpp files), it will
have relocation error when I use opt -mypass to run it. I have tried to
squeeze everything in one file, then all errors are gone. But when the
program goes large(or have more than one classes), I don't think it is
wise to do so. So I really want to make it clear where I made the
mistake.<br>
<br>
<br>
For example, CLASS FullIFDuplica has a memember method "bool
isTwowayBranch()", whose implemention is in ClassImplement.cpp. Then if
this method is called in FullIFDuplica.cpp, error occurs.<br>
<br>
opt: relocation error: /home/snir/jingyu/resources/llvm/JingProject/IFDup/Debug/<br>
lib/FullIFDuplica.so.0: undefined symbol: _ZN46_GLOBAL__N_FullIFDuplica.cpp_9D21<br>
64D3_FF44884A20FullIFDuplica14isTwowayBranchEPN4llvm10BasicBlockE<br>
<br>
 I find that the symbol table of the generated library has two entrys for this method. <br>
(U).....FullIFDuplica.cpp_9D2164D3_FF44884A20FullIFDuplica14isTwowayBranch.. <br>
  and<br>
(T).....ClassImplement.cpp_9D2164D3_FF44884A20FullIFDuplica14isTwowayBranch..<br>
<br>
One is defined, the other is not. Seems that the run time has no way to associate these two symbols.<br>
<br>
<br>
Could you tell me how to solve the problem? <br>
<br>
Thanks very much!<br>
<br>
Jing<br>