0

1 I have included bits/stdc++ header file in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1. even though it gave me an error.

2 After that I have changed Header search paths of my project to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1. then the error got fixe.but ,when I am trying to compile my code it is showing Build failed.

  • 10
    [Don't](https://stackoverflow.com/q/31816095/10077). Seriously. Specify the headers you need. – Fred Larson May 25 '21 at 20:17
  • 3
    @Fred I would upvote your comment twice (nay, thrice) if I could. – Adrian Mole May 25 '21 at 20:18
  • 2
    Here's the very short example I use to show just how fast that include (and it's nigh-obligatory partner `using namespace std;`) can screw up a program: https://godbolt.org/z/895Tvd9vK All that changed in the code is a compiler update. Behind the scenes the default C++ Standard changed and `std::size` was added to the language. Ka-BOOM. – user4581301 May 25 '21 at 20:30
  • 1
    *How can I `#include `...?* Why would you want to? That's compiler specific, and makes your program non-portable. For example, maybe you'd want to port the code to Xcode 12.5 on macOS Big Sur. – Eljay May 25 '21 at 21:25
  • @user4581301 -- You can add `std::data` to the list. Can't wait for those "competitive programmers" who like that header scratch their head for hours trying to figure out why their program fails to compile, and then lose the "competition". – PaulMcKenzie May 25 '21 at 21:51
  • Thing is it's not the serious competitors that really suffer. They practice this well ahead of time and will trip over these problems months before they get slapped upside the head by them in a timed challenge like the ACM competitions. It's the poor schmos who get caught in the crossfire, thinking they got some slick code they can pass off, and through them, us who have to deal with it. – user4581301 May 25 '21 at 22:09

0 Answers0