Originally, the problem is the lack of .cpp file. Then I noticed the
compilation log is not showing the .o file being generated for the non-pass
classes.
Then I added the .cpp files for each .h file, then the .o files are being
generated, shown in the Debug directory. Actually, if I add "VERBOSE =
1"
in the Makefile, it shows the linking command is actually linking all the
.o files into the pass.so file.
Any help will be appreciated.
Thanks!
Welson
On Thu, Mar 1, 2012 at 6:45 AM, John Criswell <criswell at illinois.edu>
wrote:
> On 2/29/12 11:03 PM, Welson Sun wrote:
>
> My pass uses another class which is defined in a separate .h file, which
> sits in the same folder as the pass .cpp file. The pass compiles fine, but
> when using the pass "opt -load ...", there is an error: opt
symbol lookup
> error .... undefined symbol xxx, where xxx is the class name. It looks
> like that class file's object file is not linked into the pass.so file.
How
> should I change the Makefile to make the linking happen?
>
>
> If your .cpp file isn't including the .h file, then the class in the .h
> file isn't being compiled and, therefore, isn't being included in
the final
> library file.
>
> Classes should be declared in header files and have their methods defined
> in .cpp files. That's the easiest way to fix the problem.
>
> -- John T.
>
>
>
> Thanks,
> Welson
>
>
> _______________________________________________
> LLVM Developers mailing listLLVMdev at cs.uiuc.edu
http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
--
Welson
Phone: (408) 418-8385
Email: welson.sun at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20120301/8a858e1a/attachment.html>