In the previous mail there was little bug, the code executed by eclipse to compile the .o file was:<div><br></div><div><div>g++ -O0 -g3 -Wall -c -fmessage-length=0 `llvm-config --cppflags --ldflags --libs core` -MMD -MP -MF"src/test.d" -MT"src/test.d" -o "src/test.o" "../src/test.cpp"</div>
<div>(which compiles fine)</div><br><div class="gmail_quote">2012/11/6 Wojciech Daniło <span dir="ltr"><<a href="mailto:wojtek.danilo.ml@gmail.com" target="_blank">wojtek.danilo.ml@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi!<div>I'm trying to learn LLVM and I want to compile the Kaleidoscope compiler.</div><div>according to:</div><div><a href="http://llvm.org/docs/tutorial/LangImpl3.html" target="_blank">http://llvm.org/docs/tutorial/LangImpl3.html</a></div>

<div><br></div><div>I'm compiling it with:</div><div><div>clang++ -g -O3 test.cpp `llvm-config --cppflags --ldflags --libs core` -o toy</div></div><div><br></div><div>and it indeed works.</div><div>The problem is that when using eclipse it forces me to divide the compilation into two steps:</div>

<div><br></div><div>g++ -O0 -g3 -Wall -c -fmessage-length=0 `llvm-config --cppflags --ldflags --libs core` -MMD -MP -MF"src/lunac.d" -MT"src/lunac.d" -o "src/test.o" "../src/test.cpp"</div>

<div>(which compiles fine)</div><div><br></div><div>and:</div><div><br></div><div><div>Invoking: Cross G++ Linker</div><div>g++ `llvm-config --cppflags --ldflags --libs core` -o "test"  ./src/test.o</div></div>
<div>
<br></div><div>which gives me error:</div><div><div>./src/test.o: In function `NumberExprAST::Codegen()':</div><div>/home/wdanilo/dev/lunac/Debug/../src/test.cpp:358: undefined reference to `llvm::APFloat::APFloat(double)'</div>

<div>/home/wdanilo/dev/lunac/Debug/../src/test.cpp:358: undefined reference to `llvm::getGlobalContext()'</div><div>/home/wdanilo/dev/lunac/Debug/../src/test.cpp:358: undefined reference to `llvm::ConstantFP::get(llvm::LLVMContext&, llvm::APFloat const&)'</div>

</div><div>[...]</div><div><br></div><div>Why Linker is not working with these flags? How can I fix it?</div><div><br></div>
</blockquote></div><br></div>