0

I code in C++. I was a Windows user, recently switched to mac. I downloaded gcc-10 from homebrew but still, whenever I compile on any editor, it got compiled with Clang.

Then I deleted Clang by going to the directory where it was stored, I thought it will then compile with GCC. But now it stops compiling and throwing error messages.

Q. Why do I wish to use gcc instead of clang? -> Clang doesn't have <bits/stdc++.h> header and while solving one question I got to know it doesn't have unordered map also (read on Stack Overflow later).

-> And I don't know what more is not there in clang.

How can I find out either how to successfully compile C++ using gcc on MAC or all the differences between clang and gcc and how should I manage them?

Even I talked with Apple Care for about 45 mins and they also don't know the solution.

halfer
  • 19,824
  • 17
  • 99
  • 186
Tushar D
  • 1
  • 2
  • 5
    [Why should I not #include ?](https://stackoverflow.com/questions/31816095/why-should-i-not-include-bits-stdc-h) – Rohan Bari Feb 21 '21 at 16:01
  • 2
    And the question you link to only talks about `unordered_map::merge`, not `unordered_map` in general. `merge` was added in C++17 so it's probably available now (three years after that question). – Thomas Feb 21 '21 at 16:03
  • In short, if you _actually_ "code in C++" (instead of some GNU dialect) then you should have no problems switching to another compiler. – Thomas Feb 21 '21 at 16:04
  • You may find [brew](https://brew.sh/) helpful, and then you can `brew install gcc` to install GCC. – Eljay Feb 21 '21 at 16:16
  • I don't think gcc is supported on that platform yet. – Marc Glisse Feb 21 '21 at 22:34

0 Answers0