[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    [cfe-dev] Problems with Clang 3.1 and libc++
From:       Pere Joan Martorell <pj.martorell () gmail ! com>
Date:       2012-11-29 0:57:46
Message-ID: 50B6B30A.4010501 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
I'm using Mac OS X 10.6 and I'm trying to compile a program using Clang 
3.1 and libc++ but one of include files of libc++ is giving problems, 
specifically one called "cmath" located in /usr/include/c++/v1/. I have 
searched about this on google and I red something about building libc++ 
with -U__STRICT_ANSI__  param but the same errors appear. I paste here 
the output:

    $ make
    [100%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o
    In file included from /Users/xxxxx/fantom/bin/foo/foo.cpp:1:
    In file included from
    /Users/xxxxx/fantom/include/fantom/algorithm.hpp:10:
    In file included from /usr/include/c++/v1/unordered_map:318:
    In file included from /usr/include/c++/v1/__hash_table:19:
    /usr/include/c++/v1/cmath:1333:9: error: no member named 'llrint' in
    the global namespace
    using ::llrint;
           ~~^
    /usr/include/c++/v1/cmath:1334:9: error: no member named 'llrintf'
    in the global namespace
    using ::llrintf;
           ~~^
    /usr/include/c++/v1/cmath:1336:86: error: use of undeclared
    identifier 'llrintf'
    inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x)
    _NOEXCEPT       {return llrintf(__x);}
    ^
    /usr/include/c++/v1/cmath:1337:86: error: use of undeclared
    identifier 'llrintl'
    inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x)
    _NOEXCEPT {return llrintl(__x);}
    ^
    /usr/include/c++/v1/cmath:1342:35: error: call to 'llrint' is ambiguous
    llrint(_A1 __x) _NOEXCEPT {return llrint((double)__x);}
                                       ^~~~~~
    /usr/include/c++/v1/cmath:1336:44: note: candidate function
    inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x)
    _NOEXCEPT       {return llrintf(__x);}
                                                ^
    /usr/include/c++/v1/cmath:1337:44: note: candidate function
    inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x)
    _NOEXCEPT {return llrintl(__x);}
                                                ^
    /usr/include/c++/v1/cmath:1346:9: error: no member named 'llround'
    in the global namespace
    using ::llround;
           ~~^
    /usr/include/c++/v1/cmath:1347:9: error: no member named 'llroundf'
    in the global namespace
    using ::llroundf;
           ~~^
    /usr/include/c++/v1/cmath:1349:87: error: use of undeclared
    identifier 'llroundf'
    inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x)
    _NOEXCEPT       {return llroundf(__x);}
    ^
    /usr/include/c++/v1/cmath:1350:87: error: use of undeclared
    identifier 'llroundl'
    inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x)
    _NOEXCEPT {return llroundl(__x);}
    ^
    /usr/include/c++/v1/cmath:1355:36: error: call to 'llround' is ambiguous
    llround(_A1 __x) _NOEXCEPT {return llround((double)__x);}
                                        ^~~~~~~
    /usr/include/c++/v1/cmath:1349:44: note: candidate function
    inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x)
    _NOEXCEPT       {return llroundf(__x);}
                                                ^
    /usr/include/c++/v1/cmath:1350:44: note: candidate function
    inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x)
    _NOEXCEPT {return llroundl(__x);}
                                                ^
    /usr/include/c++/v1/cmath:1649:9: error: no member named 'llrintl'
    in the global namespace
    using ::llrintl;
           ~~^
    /usr/include/c++/v1/cmath:1650:9: error: no member named 'llroundl'
    in the global namespace
    using ::llroundl;
           ~~^
    12 errors generated.
    make[2]: *** [CMakeFiles/foo.dir/foo.cpp.o] Error 1
    make[1]: *** [CMakeFiles/foo.dir/all] Error 2
    make: *** [all] Error 2

I have built libc++ without any problem and all paths are correct, the 
only thing is that the testing application "testit" is doing the tests 
using the Clang version that came with XCode (which is not compatible 
with Mac OSX 10.6) instead of the one that I installed with Macports. Is 
there any way to define a specific compiler to do the tests?

Thank you,

Pere Joan

[Attachment #5 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    I'm using Mac OS X 10.6 and I'm trying to compile a program using
    Clang 3.1 and libc++ but one of include files of libc++ is giving
    problems, specifically one called "cmath"
    <meta charset="utf-8">
    located in /usr/include/c++/v1/. I have searched about this on
    google and I red something about building libc++ with
    -U__STRICT_ANSI__&nbsp; param but the same errors appear. I paste here
    the output:<br>
    <blockquote>$ make<br>
      [100%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o<br>
      In file included from /Users/xxxxx/fantom/bin/foo/foo.cpp:1:<br>
      In file included from
      /Users/xxxxx/fantom/include/fantom/algorithm.hpp:10:<br>
      In file included from /usr/include/c++/v1/unordered_map:318:<br>
      In file included from /usr/include/c++/v1/__hash_table:19:<br>
      /usr/include/c++/v1/cmath:1333:9: error: no member named 'llrint'
      in the global namespace<br>
      using ::llrint;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~~^<br>
      /usr/include/c++/v1/cmath:1334:9: error: no member named 'llrintf'
      in the global namespace<br>
      using ::llrintf;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~~^<br>
      /usr/include/c++/v1/cmath:1336:86: error: use of undeclared
      identifier 'llrintf'<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x)
      _NOEXCEPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {return llrintf(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


      ^<br>
      /usr/include/c++/v1/cmath:1337:86: error: use of undeclared
      identifier 'llrintl'<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x)
      _NOEXCEPT {return llrintl(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


      ^<br>
      /usr/include/c++/v1/cmath:1342:35: error: call to 'llrint' is
      ambiguous<br>
      llrint(_A1 __x) _NOEXCEPT {return llrint((double)__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^~~~~~<br>  /usr/include/c++/v1/cmath:1336:44: note: candidate function<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x)
      _NOEXCEPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {return llrintf(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>  /usr/include/c++/v1/cmath:1337:44: note: candidate function<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x)
      _NOEXCEPT {return llrintl(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>  /usr/include/c++/v1/cmath:1346:9: error: no member named 'llround'
      in the global namespace<br>
      using ::llround;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~~^<br>
      /usr/include/c++/v1/cmath:1347:9: error: no member named
      'llroundf' in the global namespace<br>
      using ::llroundf;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~~^<br>
      /usr/include/c++/v1/cmath:1349:87: error: use of undeclared
      identifier 'llroundf'<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x)
      _NOEXCEPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {return llroundf(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


      ^<br>
      /usr/include/c++/v1/cmath:1350:87: error: use of undeclared
      identifier 'llroundl'<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llround(long double
      __x) _NOEXCEPT {return llroundl(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


      ^<br>
      /usr/include/c++/v1/cmath:1355:36: error: call to 'llround' is
      ambiguous<br>
      llround(_A1 __x) _NOEXCEPT {return llround((double)__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^~~~~~~<br>  /usr/include/c++/v1/cmath:1349:44: note: candidate function<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x)
      _NOEXCEPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {return llroundf(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>  /usr/include/c++/v1/cmath:1350:44: note: candidate function<br>
      inline _LIBCPP_INLINE_VISIBILITY long long llround(long double
      __x) _NOEXCEPT {return llroundl(__x);}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>  /usr/include/c++/v1/cmath:1649:9: error: no member named 'llrintl'
      in the global namespace<br>
      using ::llrintl;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~~^<br>
      /usr/include/c++/v1/cmath:1650:9: error: no member named
      'llroundl' in the global namespace<br>
      using ::llroundl;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~~^<br>
      12 errors generated.<br>
      make[2]: *** [CMakeFiles/foo.dir/foo.cpp.o] Error 1<br>
      make[1]: *** [CMakeFiles/foo.dir/all] Error 2<br>
      make: *** [all] Error 2<br>
    </blockquote>
    I have built libc++ without any problem and all paths are correct,
    the only thing is that the testing application "testit" is doing the
    tests using the Clang version that came with XCode (which is not
    compatible with Mac OSX 10.6) instead of the one that I installed
    with Macports. Is there any way to define a specific compiler to do
    the tests?<br>
    <br>
    Thank you,<br>
    <br>
    Pere Joan<br>
  </body>
</html>



_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic