Using C++17 to build ios apps? [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 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.

Related

How to get a C++17 environment on macOS High Sierra? [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 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

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.

What is the most complete and reliable open source C++11 IDE for Windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I don't intend this to be an opinion question and I am deliberately avoiding the word "best" for that reason. To frame my question differently;
Is there a fully C++11 compatible Open Source and free (as in free speech, beer and lunch, not as in Express, Lite, Demo, etc.) IDE that provides stable syntax and error highlighting a la IntelliSense, that works out of the box with C++11, or at least with a minimal, easy to follow amount of work?
I am asking this question because I really like the VS2012 environment but have become frustrated with the lackluster degree of C++11 compatibility, and my license is due to expire anyway.
Have you tried the "Visual C++ Compiler November 2012 CTP" update? It adds support for several features (most notably variadic templates) to VC11. The library is not there, and this compiler update is not considered production-ready, but I've found it to be great for working on my projects and using C++11 code till the final product comes out.
Also, I have used Qt Creator (quite independent from the Qt toolkit) for GCC-based C++11 development and it's a great IDE.
First: it's not (mainly) the IDE that needs the C++11 Support, but the compiler. That being said - here are some options:
it is possible to integrate clang into VS2012 (check here: https://github.com/ishani/ClangVSx)
You can use any IDE that supports MINGW as compiler (Windows-GCC-Port) e.g. Eclipse CDT, QT Creator, Code::Blocks, DevCpp
You can use any IDE that supports Clang as compiler (e.g. Code::Blocks)
According to http://www.codelite.org/LiteEditor/ClangIntegration, you can configure codelite to use Clang for code completion vs. gcc. So depending on the IDE, the compiler might provide things like code completion.