1 Reply
      Latest reply on Feb 28, 2019 6:45 PM by jonprescott
      Stokestack Level 1 Level 1 (0 points)

        Hi all.

         

        I tried to use aligned_alloc and it's nowhere to be found. It was included in C11 and C++ 17. I have my C++ Xcode language dialect set for C++17 (it's listed in the drop-down), but the "C++ standard library" drop-down only shows LLVM "with C++ 11 support."

         

        Anybody know what gives here? This is Mac OS 10.14.3 and Xcode 10.1.

         

        Thanks!

        • Re: Where are the C++17 features, like aligned_alloc?
          jonprescott Level 2 Level 2 (70 points)

          Have you set the C language dialect to C11 in addtion to the C++ language dialect?. 

           

          The libc++ library, although labeled with "C++11 Support", is used with C++11, C++14, and C++17.

           

          aligned_alloc is defined in stdlib.h for C11.  C++11 (and beyond) inherit through cstdlib, which include stdlib.h which includes stdlib.h in C11.

          It's there.