<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Zhou,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>What's the commandline you're using to compile this program? Are you using "llvm-gcc" or "llvm-g++"? You'll need to use the latter for C++ programs.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-bw</DIV><DIV><BR><DIV><DIV>On Sep 15, 2006, at 7:07 PM, Zhou Sheng wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Hi,<BR><BR>i have compile and built the llvm-gcc4 and llvm 1.8a in my machine, but there is some problem about llvm-gcc4. It can not compile a<BR>cpp code like this:<BR>#include <iostream><BR>using std::cout;<BR>using std::endl; <BR><BR>int main()<BR>{<BR>    cout << "Hello" << endl;<BR>}<BR><BR>$llvm-g++ hello.cc -o hello<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK8' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK11'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK0' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK14'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK7' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK3'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK9' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK13'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'std::basic_istream<char, std::char_traits<char> >::ignore(int) ' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK1'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK4' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'std::basic_istream<wchar_t, std::char_traits<wchar_t> >::ignor e(int)'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK6' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK12'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK15' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK10'<BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK5' <BR>/developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK2'<BR>collect2: ld return 1<BR><BR>i have also used the binary version of llvm-gcc from <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://llvm.org/" target="_blank">llvm.org</A>, the result is as the same.<BR><BR>BTW: the compilation of c code is OK.<BR><BR>Thanks,<BR>Sheng<BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">LLVM Developers mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A> <SPAN class="Apple-converted-space">        </SPAN><A href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>