[LLVMdev] Dose I need to build llvm-gcc front-end from source resolve this error?

Sheng Wang wansheg at gmail.com
Fri Sep 4 00:23:22 PDT 2009


/*
     mm.cpp
*/
#include<iostream>
using namespace std;
struct  xx{
int x;
        int mm()const;
        int mm();
};

int xx::mm() const
{
        return const_cast<xx*>(this)->mm();
}

int xx::mm()
{
        cout<<"ok"<<endl;
        return x;
}

int main()
{
        xx x;
        x.mm();
        return 0;
}

/*********************************************************************************************************************/

[ws at localhost dev]$ llvm-c++ --emit-llvm mm.cpp 
In file included from /home/ws/software/llvm-gcc4.2-2.5-x86-linux-RHEL4/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/cstring:52,
                 from /home/ws/software/llvm-gcc4.2-2.5-x86-linux-RHEL4/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/i686-pc-linux-gnu/bits/c++locale.h:47,
                 from /home/ws/software/llvm-gcc4.2-2.5-x86-linux-RHEL4/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/iosfwd:45,
                 from /home/ws/software/llvm-gcc4.2-2.5-x86-linux-RHEL4/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/ios:43,
                 from /home/ws/software/llvm-gcc4.2-2.5-x86-linux-RHEL4/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/ostream:45,
                 from /home/ws/software/llvm-gcc4.2-2.5-x86-linux-RHEL4/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/iostream:45,
                 from mm.cpp:1:
/usr/include/string.h:546: error: ‘__locale_t’ has not been declared
/usr/include/string.h:547: error: nonnull argument references non-pointer operand (argument 1, operand 3)
/usr/include/string.h:550: error: ‘__locale_t’ has not been declared
/usr/include/string.h:551: error: nonnull argument references non-pointer operand (argument 1, operand 4)

In my system , gcc-3.4.6 is used as default gcc tool;

thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090904/84a353e1/attachment.html>


More information about the llvm-dev mailing list