First, I shoud thank you for your suggested solution. Now, I have another question. I use the following command to generate executable file from llvm bitcode:<br><br><br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 8:18 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Jan 9, 2013 at 5:32 AM, Ali Sedaghat <<a href="mailto:ali.sedaghatbaf@gmail.com">ali.sedaghatbaf@gmail.com</a>> wrote:<br>

> I'm developing an llvm-based compiler and when I try to generate<br>
> executable file the following error occurs:<br>
><br>
> ./bin/llvmcode.s:35: undefined reference to `operator new[](unsigned<br>
> long)'<br>
><br>
> Note that in the generated IR, the function '@_Znam' is called which is<br>
> located in one of llvm libraries. So, I should have linked the generated<br>
> assembly file with that library.<br>
<br>
</div>That operator is defined in the C++ standard library. You probably<br>
don't want to be linking the output of your compiler with LLVM<br>
libraries, they'd be what you'd use to build the compiler itself.<br>
<br>
However, g++ should find the required function anyway. It's possible<br>
you have to add a "-lstdc++" (or -lc++ if you're using libc++, etc).<br>
But it makes me wary about the rest of your toolchain.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br>