Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
can someone recommend a compiler that supports c++ 14 on the OS X platform? I'm studying programming and principles by Bjarne Stroustrup and need some assistance with acquiring the appropriate compiler for the context of the book (c++ 14).
The best compiler for use on OS X is clang. C++14 is fully supported in clang as of 3.4: http://clang.llvm.org/cxx_status.html.
The current Xcode 6 betas come with a 3.4 based clang so you can just use that.
(Source: I am a compiler engineer working at Apple)
You should install Macports and then you have a choice of GCC 4.8 or 4.9 and Clang 3.5 or 3.6 by simply typing:
$ sudo port install clang-36
or
$ sudo port install gcc49
Note: you'll want to have Xcode installed first.
The standard compiler provided by apple is Clang. Here it claims it is c++14 aware:
http://clang.llvm.org/cxx_status.html#cxx14
To get it available I think the easiest way is to install Xcode.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
macOS High Sierra and Xcode 9 come with an old version of LLVM. It's not obvious which version of LLVM it is because of version number mangling. However, it's apparent it's old as the latest version of LLVM supports C++17 but features like std::optional are not available.
I'd like to write some C++17 code using a Mac. What toolchains are available and what has the fewest complications to get working? My thoughts so far:
LLVM via Homebrew -- interference with/by Xcode?
GCC via Homebrew
Above compiled from source
Any preferred method?
This 'answer' is not an answer to your question. These are the handy bookmarks I use.
I'd use Homebrew to install clang++ (see link below). But if you really want Xcode to interop with it, I'd suggest the "bad news" of wait for Apple, or try out their latest beta. And keep in mind that Apple's "Objective-C++" (*.mm) probably requires Apple's secret sauce, if you have some sort of C++ / Cocoa project.
C++17 implementation status:
https://clang.llvm.org/cxx_status.html
Xcode -to- CLang version:
https://gist.github.com/yamaya/2924292
Homebrew to get CLang (clang++):
https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
How can I install the C++ compiler on Mac? I need compiler like MinGW on Windows or G++ on Ubuntu, not Clang, that's important.
It is a simple three-step process:
Install Xcode as described here.
Having a C and C++ compiler, now compile the preconditions for the installation of gcc.
Compile and install gcc according to the instructions for gcc. It is a while since I last compiled gcc with clang: you may need to first compile an older release of gcc and use that to compile the actual version of gcc you want.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am looking for anyway to set up C++ OpenCV on my mac. I've found numerous articles online but they all end up giving errors of some kind. I am completely indifferent to everything but the C++ part (for example flexible on the use of Xcode). Please don't link an article or post a method unless it has recently worked. I've already gone through tons of those. Any help would be very appreciated, I've been stuck for a couple days on this.
Details: Xcode 5, OS 10.9.4
Off Topic Edit: I realize this is a vague question but I'm not really looking for the best tool or solution. Just any one that would work.
brew tap homebrew/science
brew info opencv
brew install opencv
The info command was added as a suggestion so that you review the options you have when installing OpenCV. I'm using homebrew.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What would be a good code editor for Linux (I use Ubuntu 14.04 LTS) which combines:
auto completion for c/c++ (more is better)
syntax highlighting
recognizing include commands and getting the code from the headers
not an IDE, rather something light
simple installation
I am not a big expert in Linux and, for example, it got too expensive for me to install SublimeClang plugin. Another thing is that I want to write the code and then run the compiler commands myself, not just by pushing a button, which is common in IDEs. Also, I don't like VIM.
If you do not want an IDE then I suggest you install Wine and then install Notepad++.
I suggest Eclipse CDT. It is a C++/C IDE that is quite lightweight and does everything you've asked. Plus it has a compiler. The instillation is quite easy. Go to the software installer and search "Eclipse CDT" and then install "CPP"
Another one, that is also an IDE but a little be more environmentally friendly is MonoC++
Also, there are online editors, such as Ideone and CompileOnline
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have been developing a C++11 application against a modern compiler on my mac/linux, which works fine but then I tried to deploy it to a very old linux box (g++ 4.1.2: Feb 2007) and of course that's too old and the executable won't work.
This isn't surprising but now I'm wondering if there is a standard amount of time you are expected to support a compiler/standard?
I had a look around but there is no mention of this.. Should the support for a compiler version drop when the developers themselves deem it end of life and will not patch bugs?
You're the one running gcc (or g++). It's a compiler, used by developers. End-user systems may not have any version of gcc. It's glibc and libstdc++ you need to worry about. But in general, Linux does not aim for binary compatibility. Do not expect any binary executable to run properly on any other distribution/major version.
Conversely, glibc and libstdc++ are careful to work with old kernel versions, so you should be able to install (configure+make+install) the latest runtime support libraries on your Linux box, and then build your application for that.
The easiest way to do that is probably to install the same distribution and version that your target has, into a virtual machine. Then install the C++11 developer tools, and build your application.