C++ compiler on MacOS [closed] - c++

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.

Related

c++ 14 compiler for OS X [closed]

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.

ANN Library problems in Fedora [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Have you had success installing ANN recently? (http://www.cs.umd.edu/~mount/ANN/)
In my computer and using the latest version available on the website, I seem to be able to install it from running make. But I can't correctly compile a program that uses it. According to the official manual you just have to compile with g++ a.cpp -Iann/include -Lann/lib -lANN but my compiler returns:
fatal error: ANN/ANN.h: No such file or directory
Has anybody been able to install it in Fedora or other linux system? Or do you have any idea of how to get it to work?
Thanks!
I just managed to solve it by changing "ann" by the path to the library root directory in "g++ a.cpp -Iann/include -Lann/lib -lANN".

What is the minimum reasonably supported GCC version? [closed]

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.

Is it legal to statically link libstdc++ and libgcc in a binary-only application? [closed]

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 7 years ago.
Improve this question
Is it legal to distribuite a binary-only application which has been built by statically linking unmodified versions of both libstdc++ and libgcc from the GCC suite version 4.7 or greater?
I am no lawyer, but I think that the faqs at GNU are pretty clear on this. Yes you can! But only if you want to distribute executables.
http://www.gnu.org/licenses/gcc-exception-faq.html
http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.license.what

How can I compile under C++11 standard in Ubuntu? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
How may I compile a C++ program under the C++11 standard in Ubuntu 11.04 with the most up-to-date compiler, at best using compiler from the distribution, i.e., pre-built package.
GCC 4.6 provides most of the C++11 features. One has only to add the flag -std=c++0x and can use range based for loops, strong enums, UTF strings, etc. For the list of features available in a given version of GCC one can check on http://gcc.gnu.org/projects/cxx0x.html.
Update in 2017: It seem GCC 7 and higher has full C++ 2011 compliance. The rest of the answer below was written in the GCC 4.7 era, and was correct when written in 2011.
Strictly speaking, I can not offer you any 100% C++ 2011 compliant open source compiler, because there aren't any that are 100% there yet.
It looks like you should stay with GCC for now, and GCC 4.6 binaries are included in recent Ubuntu distributions. C++ 2011 is incomplete in GCC 4.6 but contains a lot of 2011 stuff, more than Clang+llvm. It's more than 90% C++ 2011 feature complete. GCC 4.7 contains yet more stuff, but I don't see gcc-4.7 binary packages in Ubuntu 11.x yet, but you can check over here for another way to get gcc 4.7 binaries on ubuntu, or try AskUbuntu, a stackexchange powered site for ubuntu.
According to this page Clang+llvm does not yet offer full C++ 2011 standards compliance, either, and I haven't done the exact math but I see a lot more "No" entries on Clang, versus Gcc.