[cfe-dev] clang build error, error: ISO C++ forbids compound-literals

Sebastian Redl sebastian.redl at getdesigned.at
Mon Oct 18 02:23:13 PDT 2010


On 18.10.2010 11:13, Leding Li wrote:
> I'm building clang 2.7 on my box, it failed as:
>
> llvm[4]: Compiling Lexer.cpp for Release build
> In file included from
> /usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/emmintrin.h:34,
>                   from Lexer.cpp:1108:
> /usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/xmmintrin.h: In
> function `float __vector__ _mm_set_ps(float, float, float, float)':
> /usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/xmmintrin.h:894: error:
> ISO C++ forbids compound-literals
> In file included from Lexer.cpp:1108:
> /usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/emmintrin.h: In
> function `double __vector__ _mm_set_pd(double, double)':
> /usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/emmintrin.h:118: error:
> ISO C++ forbids compound-literals
> make[4]: *** [/home/work/lileding/pkgsrc/lang/clang/work/llvm-2.7/tools/clang/lib/Lex/Release/Lexer.o]
> Error 1
>
> I've tried both Release and Debug+Assert, all the same.
> Anyone can help me?
>    
Your include paths are problematic. Clang provides its own versions of 
the SSE headers and should use those, but apparently on your system the 
GCC ones are preferred.

Sebastian



More information about the cfe-dev mailing list