1

I was struggling to get some C++ code that involves the header

#include <execution>

working in XCode (Version 11.4 (11E146)) through macOS Catalina Version 10.15.3, as it failed with error:

'execution' file not found

Finally I was able to compile my code by installing the gcc-HEAD version from brew:

$ g++ --version
  g++ (Homebrew GCC HEAD-93a49d2) 10.0.1 20200407 (experimental)

However, I'm still struggling to use this g++-HEAD version through XCode. I tried in XCode's "Build Settings" this way: enter image description here I also tried to change in above settings: Dialect from C++17 to GNU++17 [-std=gnu++17], and C++ Standard Library to libstdc++ (GNU C++ standard library). But XCode still complains that it couldn't find 'execution' file. As suggested by @walnut, it seems that I need to set up the clear path to the entirely different compiler other than XCode's default clang. What shall I write down in the below window? enter image description here Thanks!

Heifetz_Fan
  • 439
  • 1
  • 6
  • 15
  • The `g++` that you installed is not "Apple Clang" as listed in the settings window. It is a different compiler entirely. I don't know XCode, but there is probably a setting to choose the path to the compiler. – walnut Apr 07 '20 at 15:11
  • @walnut: I agree with you. The question is how to set the other compiler? – Heifetz_Fan Apr 07 '20 at 15:18
  • Maybe [How do I change the compiler in Xcode](https://stackoverflow.com/questions/18818685/how-do-i-change-the-compiler-in-xcode?) and/or [How can I force Xcode to use a custom compiler?](https://stackoverflow.com/questions/39327952/how-can-i-force-xcode-to-use-a-custom-compiler) answer this question? – walnut Apr 07 '20 at 15:26
  • Thanks @walnut. Unfortunately I still couldn't figure out how to configure the XCode. I've modified my questions a little to reflect my current questions. – Heifetz_Fan Apr 07 '20 at 18:34

0 Answers0