Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does use of C++17 std::filesystem REQUIRE MacOS 10.15? (Xcode 11.1)

Using Xcode 11.1, building on MacOS 10.14.6 (Mojave), the following lines:

#include <filesystem>
typedef std::filesystem::path my_path;

...generate this compiler error:

'path' is unavailable: introduced in macOS 10.15

Does this mean I can't build for earlier versions of MacOS (10.13, 10.14) FROM 10.14, or that I can't generate an executable from 10.15 that can target/run on versions of MacOS that are EARLIER than 10.15?

like image 874
SMGreenfield Avatar asked Nov 02 '19 02:11

SMGreenfield


People also ask

Which Xcode is supported in macOS Catalina?

The macOS 10.15 SDK provides support for developing apps for Macs running macOS Catalina 10.15. The SDK comes bundled with Xcode 11 available from the Mac App Store.

Does Xcode support C ++ 11?

Start with Clang - Many C++11 features are now available in Clang. It's included with Xcode.

Is Xcode compatible with Mojave?

For macOS 10.14. 4, Xcode versions compatible are: Xcode 10.2 - 11.3.


1 Answers

It means that (using Apple's tools/libraries), you cannot use std::filesystem in a project targeting a version of Mac OS before 10.15.

If you have a new enough Xcode, etc. you should be able to build a project on 10.14 (say) that targets 10.15 and uses filesystem types and calls. But it won't run on 10.14.

like image 191
Marshall Clow Avatar answered Sep 28 '22 03:09

Marshall Clow