-
-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build on Xcode 9.3 fails: It seems to define __cplusplus to 201703L without having <optional> #201
Comments
I'm having a similar issue, but after solving the optional part, had problems with variant. It seems that for Xcode 9.3, the following ward fails:
After forcing to disable that (using && 0) it gives me the following error:
I'm using Apple LLVM version 9.1.0 (clang-902.0.39.1) |
Thank you for the report and details @juan-cardelino. I've added Xcode 9.3 to travis (9266d8e) so that we can track it, and indeed it fails there as well. It's weird that after "manually" editing that check with I am afraid I won't have time to properly look at that in the next few weeks, but above should really get you going. |
Dear Patrik, |
I've carefully searched all occurrences and disabled all of them. Then I got an error on auto_ptr, like @Yang8510. But I realized it was actually a boost error. I replaced my current boost (1.60) by the newest one (1.67) and worked like a charm. |
@juan-cardelino Hey cool, that's awesome! Thank you very much for reporting back. I'm glad all is working well now :-) So I guess we just need to add something to that |
Thank you very much for the help. Great work! |
I have boost 1.67 but the python module still doesn't build on High Sierra |
@akrymski What's your error? I am sure you can fix it by adjusting above |
I managed to compile the code with xcode. Clang doesn't fully support C++17, however the following expression resolves to true when compiling with clang For more information refer to the following answer about Clang's C++17 support: https://stackoverflow.com/a/47794453 I created a patch, that fixes this problem when compiling with Clang (or Xcode). Save it as a .patch file and apply the patch as follows (with git): $ git am < file.patch From fd8bb883ef8ae92d790f4a52c2df00753fd8272c Mon Sep 17 00:00:00 2001
From: MaG <maguilamo.c@gmail.com>
Date: Wed, 29 Aug 2018 16:08:02 -0400
Subject: [PATCH] Fix compile type error when using Clang
Clang doesn't fully support C++17, however the following directive
__cplusplus >= 201703L is true when compiling with Clang.
In order to make this code compile under clang, whe have to
prevent make clang from compiling C++17 code, to do so, I
just removed clang from any clause that requires C++17.
---
include/eos/cpp17/optional.hpp | 2 +-
include/eos/cpp17/optional_serialization.hpp | 2 +-
include/eos/cpp17/variant.hpp | 2 +-
include/eos/cpp17/variant_serialization.hpp | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/eos/cpp17/optional.hpp b/include/eos/cpp17/optional.hpp
index ea52007..ab5943d 100644
--- a/include/eos/cpp17/optional.hpp
+++ b/include/eos/cpp17/optional.hpp
@@ -22,7 +22,7 @@
#ifndef EOS_OPTIONAL_HPP_
#define EOS_OPTIONAL_HPP_
-#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#if !defined(__clang__) && (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L))
#include <optional>
namespace eos {
namespace cpp17 {
diff --git a/include/eos/cpp17/optional_serialization.hpp b/include/eos/cpp17/optional_serialization.hpp
index caa7b05..3bf1eec 100644
--- a/include/eos/cpp17/optional_serialization.hpp
+++ b/include/eos/cpp17/optional_serialization.hpp
@@ -22,7 +22,7 @@
#ifndef EOS_OPTIONAL_SERIALIZATION_HPP_
#define EOS_OPTIONAL_SERIALIZATION_HPP_
-#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#if !defined(__clang__) && (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L))
#include "cereal/types/optional.hpp"
#else
#include "eos/cpp17/detail/akrzemi1_optional_serialization.hpp"
diff --git a/include/eos/cpp17/variant.hpp b/include/eos/cpp17/variant.hpp
index 2da8a72..c932cfd 100644
--- a/include/eos/cpp17/variant.hpp
+++ b/include/eos/cpp17/variant.hpp
@@ -22,7 +22,7 @@
#ifndef EOS_VARIANT_HPP_
#define EOS_VARIANT_HPP_
-#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#if !defined(__clang__) && (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L))
#include <variant>
namespace eos {
namespace cpp17 {
diff --git a/include/eos/cpp17/variant_serialization.hpp b/include/eos/cpp17/variant_serialization.hpp
index 5aa4798..a8166c3 100644
--- a/include/eos/cpp17/variant_serialization.hpp
+++ b/include/eos/cpp17/variant_serialization.hpp
@@ -22,7 +22,7 @@
#ifndef EOS_VARIANT_SERIALIZATION_HPP_
#define EOS_VARIANT_SERIALIZATION_HPP_
-#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#if !defined(__clang__) && (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L))
#include "cereal/types/variant.hpp"
#else
#include "eos/cpp17/detail/mpark_variant_serialization.hpp"
--
2.14.1 |
When I built with Xcode, it came out the error "optional" not found. When I change it to experimental/optional, the error turns to boost/shared_ptr.hpp auto_ptrs.
The text was updated successfully, but these errors were encountered: