问题描述
有没有人使用 Visual Studio 2013 Express 成功构建过 Boost?
我很困惑这是否可行,正如 Boost 网站所说:
<块引用>Visual Studio 2013/Visual C++ 12 的已知错误.
Visual Studio 2013 在发布过程中发布较晚,因此存在一些未解决的问题.其中包括:
由于缺少包含,序列化无法编译.
使用 Boost.Container 的 allocator_traits 中的 has_member_function_callable_with 会导致编译错误 (#9332).
在 Unordered 和 MultiIndex 等库中,使用初始化列表调用重载函数会导致编译错误,Visual C++ 声称重载不明确.这是一个 Visual C++ 错误,目前尚不清楚是否有好的解决方法.这不会影响不使用初始化列表的代码,或使用不需要隐式转换的初始化列表(即容器的确切值类型的初始化列表).
线程:ex_scoped_thread 编译失败 (#9333).
但是,这张海报表示可以使用 VS 2013 构建 Boost 1.55.0,无需任何补丁.>
我曾尝试使用 VS 2013 构建 Boost,但确实至少遇到了序列化错误.
我最近仅使用一个小补丁就在 MSVC12 (VS2013) 上构建了 Boost:
<块引用>主题:[PATCH] 在 MSVC2013 上修复 boost 序列化构建
包括修复(手动)
config_decltype_n3276_new.patch(来自 https://svn.boost.org/trac/boost/ticket/9410)
如您所见,它结合了来自 https://svn.boost.org/trac/boost/的补丁ticket/9410 带有一些手动包含修复(它们是微不足道的).
这是有效的补丁:
diff --git a/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp b/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp索引 5a5c7b7..8da85ee 100644--- a/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp+++ b/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp@@ -29,6 +29,7 @@#include #include +#include <算法>命名空间提升{命名空间存档{diff --git a/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp b/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp索引 695fa94..1c0f4f0 100644--- a/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp+++ b/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp@@ -180,13 +180,13 @@# 定义 BOOST_NO_CXX11_TRAILING_RESULT_TYPES# 定义 BOOST_NO_CXX11_VARIADIC_TEMPLATES# 定义 BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX+# 定义 BOOST_NO_CXX11_DECLTYPE_N3276#万一//任何版本都不支持 C++11 特性#define BOOST_NO_CXX11_CHAR16_T#define BOOST_NO_CXX11_CHAR32_T#define BOOST_NO_CXX11_CONSTEXPR-#define BOOST_NO_CXX11_DECLTYPE_N3276#define BOOST_NO_CXX11_NOEXCEPT#define BOOST_NO_CXX11_UNICODE_LITERALS#define BOOST_NO_SFINAE_EXPR差异 --git a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp索引 216300c..1c0e6c7 100644--- a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp+++ b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp@@ -32,6 +32,6 @@int main( int, char *[] ){- 返回 boost_no_decltype_n3276::test();+ 返回 boost_no_cxx11_decltype_n3276::test();}差异 --git a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp索引 35427be..86e3664 100644--- a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp+++ b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp@@ -27,11 +27,11 @@#ifndef BOOST_NO_CXX11_DECLTYPE_N3276#include "boost_no_decltype_n3276.ipp"#别的-命名空间 boost_no_decltype_n3276 = empty_boost;+命名空间 boost_no_cxx11_decltype_n3276 = empty_boost;#万一int main( int, char *[] ){- 返回 boost_no_decltype_n3276::test();+ 返回 boost_no_cxx11_decltype_n3276::test();}
即使使用 EPA Portable Archive 实现,序列化也能很好地工作
免责声明 这是常规"Visual Studio.它可能适用于 VS Express.(如果你有 Windows SDK)
Has anyone successfully built Boost using Visual Studio 2013 Express?
I'm confused as to whether or not this is possible just yet as the Boost website states:
Known Bugs with Visual Studio 2013/Visual C++ 12.
Visual Studio 2013 was released quite late in the release process, so there exist several unresolved issues. These include:
Serialization can't compile because of a missing include.
Using has_member_function_callable_with from Boost.Container's allocator_traits causes a compile error (#9332).
In libraries such as Unordered and MultiIndex, calling overloaded functions with initializer lists can result in a compile error, with Visual C++ claiming that the overloads are ambiguous. This is a Visual C++ bug and it isn't clear if there's a good workaround. This won't affect code that doesn't use initializer lists, or uses an initializer list that doesn't require an implicit conversion (i.e. an initializer list of the container's exact value type).
Thread: ex_scoped_thread compile fails (#9333).
However, this poster says it is possible to build Boost 1.55.0 using VS 2013 without any patches.
I have tried to build Boost using VS 2013 and I do indeed get at least the Serialization error.
I've recently built Boost on MSVC12 (VS2013) using only a minor patch:
Subject: [PATCH] Fixing boost serialization build on MSVC2013
include fix (manual)
config_decltype_n3276_new.patch (from https://svn.boost.org/trac/boost/ticket/9410)
As you can see it combines the patch from https://svn.boost.org/trac/boost/ticket/9410 with some manual include fixes (they were trivial).
This is the effective patch:
diff --git a/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp b/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp
index 5a5c7b7..8da85ee 100644
--- a/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp
+++ b/3rdparty/boost_1_55_0/boost/archive/iterators/transform_width.hpp
@@ -29,6 +29,7 @@
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_traits.hpp>
+#include <algorithm>
namespace boost {
namespace archive {
diff --git a/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp b/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp
index 695fa94..1c0f4f0 100644
--- a/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp
+++ b/3rdparty/boost_1_55_0/boost/config/compiler/visualc.hpp
@@ -180,13 +180,13 @@
# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_DECLTYPE_N3276
#endif
// C++11 features not supported by any versions
#define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_CXX11_CONSTEXPR
-#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_SFINAE_EXPR
diff --git a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp
index 216300c..1c0e6c7 100644
--- a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp
+++ b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_fail.cpp
@@ -32,6 +32,6 @@
int main( int, char *[] )
{
- return boost_no_decltype_n3276::test();
+ return boost_no_cxx11_decltype_n3276::test();
}
diff --git a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp
index 35427be..86e3664 100644
--- a/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp
+++ b/3rdparty/boost_1_55_0/libs/config/test/no_decltype_n3276_pass.cpp
@@ -27,11 +27,11 @@
#ifndef BOOST_NO_CXX11_DECLTYPE_N3276
#include "boost_no_decltype_n3276.ipp"
#else
-namespace boost_no_decltype_n3276 = empty_boost;
+namespace boost_no_cxx11_decltype_n3276 = empty_boost;
#endif
int main( int, char *[] )
{
- return boost_no_decltype_n3276::test();
+ return boost_no_cxx11_decltype_n3276::test();
}
Serialization works nicely even with the EPA Portable Archive implementation
Disclaimer This is with 'regular' Visual Studio. It will probably work with VS Express. (if you have the Windows SDK)
这篇关于使用 Visual Studio 2013 (Express) 构建提升的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!