<div dir="ltr"><div></div><div>


        
        <span></span>
        
        

<p style="margin-bottom:0cm;line-height:100%;background:transparent none repeat scroll 0% 0%">
<span style="font-style:normal">Respected Sir<br></span></p><p style="margin-bottom:0cm;line-height:100%;background:transparent none repeat scroll 0% 0%"><span style="font-style:normal">My </span><span style="font-style:normal">research </span><span style="font-style:normal"> is </span><span style="font-style:normal">to
develop a </span><span style="font-style:normal">compiler
optimization algorithm </span><span style="font-style:normal">and
implement it using LLVM</span><span style="font-style:normal">. As a
part of that i am now started to study LLVM. I installed LLVM 8.0 in
ubuntu 19.04.</span></p><p style="margin-bottom:0cm;line-height:100%;background:transparent none repeat scroll 0% 0%"><span style="font-style:normal"> As a beginner, i created 3 files: </span>
</p>
<p style="margin-bottom:0cm;line-height:100%;background:transparent none repeat scroll 0% 0%">           <span style="font-style:normal">one
in Transforms directory  </span><span style="font-style:normal">called
<b>header.cpp </b>which d</span><span style="font-style:normal">efines the
function </span><b><span style="font-style:normal">printName()</span></b><span style="font-style:normal">
declared in the header file </span><span style="font-style:normal"><b>header.h</b>,
</span><span style="font-style:normal">which is in the subdirectory
</span><span style="font-style:normal"><b>PrintName</b> </span><span style="font-style:normal">of
Transforms. And the third file is the </span><b><span style="font-style:normal">PrintMain.</span></b><span style="font-style:normal"><b>cpp
</b>file in the same subdirectory. </span>
</p>
<p style="margin-bottom:0cm;line-height:100%;background:transparent none repeat scroll 0% 0%">

</p>
<p style="margin-bottom:0cm;line-height:100%;background:transparent none repeat scroll 0% 0%"><span style="font-style:normal">First
i issued make command in build subdirectory. </span><span style="font-style:normal">It
ran successfully.</span><span style="font-style:normal"> </span><span style="font-style:normal">But
w</span><span style="font-style:normal">hen i issued the opt command
:</span></p>
<p style="margin-bottom:0cm;font-style:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">

</p>
<p style="margin-bottom:0cm;font-style:normal;line-height:100%;background:transparent none repeat scroll 0% 0%"><font style="font-size:12pt" size="3">~/llvm-8.0.0.src/test$
<b>opt -load /home/aman/build/lib/LLVMPrintMain.so -printmain input.ll</b></font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">


</p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:11pt" size="2">the following error is
displayed:</font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">


</p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:13pt" size="3">opt: symbol lookup error:
/home/aman/build/lib/LLVMPrintMain.so: undefined symbol:
<b>_ZN7Printer9printNameEv</b></font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<br>

</p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:13pt" size="3">Here the function called
printName() which is in the Printer class contains only one print
statement. </font>
</p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:13pt" size="3">Input.c file contains a simple
function which is converted into input.ll using clang command.</font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<br>

</p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:13pt" size="3">The runOnfunction()  executes the function returned  from
the input.ll file accordingly.</font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<br>

</p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:13pt" size="3">It will be very grateful if
you could help me in this regard.</font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">

<br></p><p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%"></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:13pt" size="3">Hoping your valuable comments</font></p><p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%"><font style="font-size:13pt" size="3"></font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<br>

</p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<font style="font-size:13pt" size="3">rahibb</font></p>
<p style="margin-bottom:0cm;font-style:normal;font-weight:normal;line-height:100%;background:transparent none repeat scroll 0% 0%">
<br>

</p>

</div></div>