Hi Zhou,
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.
-bw
On Sep 15, 2006, at 7:07 PM, Zhou Sheng wrote:
> Hi,
>
> 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
> cpp code like this:
> #include <iostream>
> using std::cout;
> using std::endl;
>
> int main()
> {
> cout << "Hello" << endl;
> }
>
> $llvm-g++ hello.cc -o hello
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK8'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK11'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK0'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK14'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK7'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK3'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK9'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK13'
> /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) '
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK1'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK4'
> /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)'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK6'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK12'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK15'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK10'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK5'
> /developer/zsth/llvm-gcc/install/bin/../lib/gcc/i686-pc-linux-gnu/
> 4.0.1/../../.. /libstdc++.so:undefined reference to 'A_::LTHUNK2'
> collect2: ld return 1
>
> i have also used the binary version of llvm-gcc from llvm.org, the
> result is as the same.
>
> BTW: the compilation of c code is OK.
>
> Thanks,
> Sheng
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20060915/ab7f5914/attachment.html>