How to get a C++17 environment on macOS High Sierra? [closed] - c++

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

Related

Using C++17 to build ios apps? [closed]

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 2 years ago.
Improve this question
The latest XCode clang has support for c++17 but I'm not sure if older iOS devices (e.g., iPhone5, iPhone6) would have the libc++ library to support that. Is there a way to find out if I can use C++17 to build ios apps that supports all supported iOS versions?
Reference:
iPhone5, with iOS12 is still supported
https://support.apple.com/guide/iphone/supported-models-iphe3fa5df43/12.0/ios/12.0
The answer is yes, to some extent. If you're back-deploying to older OSes, there are things from C++17 you'll be able to use, and others you won't be able to use. Just try using it and you'll get a compiler error if it's not available on your deployment target. This requires telling the compiler your deployment target, which is usually done with -mios-version-min=<version> (or similar for other platforms).
Specifically, a feature X that is implemented in the system library (libc++.dylib) won't be supported on OSes older than the first version that shipped a libc++.dylib with support for X. Anything that does not require any sort of library support, i.e. that is all implemented in the headers, will work.
We maintain availability markup in the libc++ headers to flag when you're using something that would break on your deployment target. This is done by using attributes like __attribute__((availability(ios,strict,introduced=<VERSION>))) on declarations that depend on something in the shared library. The compiler does the rest of the job -- if you try to use a declaration that hasn't been "introduced" in the deployment target that you specify, it will let you know.
Edit: I'm using iOS as an example above, but this works for macOS, watchOS and all other Apple platforms.

Are the boost-C++-libraries compatible with win98? [closed]

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 6 years ago.
Improve this question
I know, it sounds ridiculous but I was asked to make an application backwards-compatible with win98. Specifically, I am interested in the boost-thread library that I have used. So, where can I find information about which version of the boost libraries is compatible with which operating system?
It depends on which version of Boost you are interested in.
You can go through the Boost version history and search the Release Notes for one that lists a compiler that supports Win98.
A quick search hints that this is likely to be MSVS 2005. This means Visual C++ 8.0.
The latest version of boost that I've found to list this version of VC++ as a supported (and targetted) compiler is boost 1.52.0.
The Boost Thread library has been around since version 1.25.0, so this seems like an acceptable candidate.
Conveniently, the link to download the source code (of any particular version) are also provided on the version history page.
See http://www.boost.org/doc/libs/1_55_0/libs/log/doc/html/log/installation.html
It requires XP or newer, and at least VC8.

C++ compiler for Linux on Windows? [closed]

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 7 years ago.
Improve this question
I'm fully aware of this question asking for the same thing. That question is closed and rather old. Accepted answer suggests rather complicated way of making your own cross-compiler and it requires cygwin.
Maybe now there are some other, simpler ways of doing this?
Actually, there is.
If you want cross-compile for linux on ARM, you can use linaro toolchain, which is available for windows. It doesn't require cygwin.
If you want cross-compile for linux on x86, that's a bit of a problem. The only ready-to-use toolchain (apart pre-built solution in that answer) that I'm aware of is "cross-compile tools" for Intel Edison (here). There are some drawbacks to it:
It will compile 32-bit linux binary
Version for windows 64-bit requires cygwin
Version for Windows 32-bit doesn't require cygwin but contains case-sensitive filenames (i.e. there are some files with names that differ only in case and windows will consider them the same file). You may have to make your Windows case-sensitive.
Windows binaries will be at "sysroots\x86_64-pokysdk-mingw32\usr\bin\i586-poky-linux"
To use edison toolchain you have to provide it with sysroot option for compilation and linking, something like this:
"i586-poky-linux-g++.exe" --sysroot=../../../../core2-32-poky-linux
ELLCC is available as a binary download for Windows, Linux, and Macs. It doesn't require cygwin, and can build Linux programs for several targets, including ARM. It is based on the clang/LLVM compiler.

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.

A good free IDE that installs with Boost for Windows? [closed]

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 8 years ago.
Improve this question
Does this exist? Can someone recomend one if it does. I was going to use minGW from the command line but Boost does not support minGW from the command line.
Figured I'd go ahead and try and install an IDE and Boost .
Edit Ok, none of these actually come with boost. I don't know of an IDE that does (and frankly I don't know why it should). Installing Boost is pretty simple as it is. I interpreted the question to be:
What nice windows IDE does support compiling with Boost?
VS Express 2010 C++: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
Code::Blocks and
eclipse CDT work with MingW
see http://ascend4.org/Binary_installer_for_Boost_on_MinGW
nuwen.net (thanks, Benjamin!)
My MinGW distribution ("distro") currently contains GCC 4.6.1 and Boost 1.47.0.
mingw-7.2.exe (16.8 MB) : This is a self-extracting archive. It's incredibly easy to install; see How To Install below.
I find BoostPro the easiest way to install pre-compiled boost binaries (libs, DLLs) and compiler pre-requisites (headers etc). http://www.boostpro.com/download/ (it's an installer that downloads whatever Boost modules you select and unzips them wherever you've told it to). All you need to do after that to use it is add the lib and include paths to your IDE/compiler. I personally recommend Visual Studio for Windows.