Building boost with Visual Studio 2013 (Express)
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)
Building boost 1.55 with Visual Studio 2013 Express
this is more or less the start of the build.log; in total there are 8 Targets skipped:
output deleted - I found a way to compile boost's serialization library - see below
Build boost on visual studio 2013 XP toolset
Check this link: https://web.archive.org/web/20130208113614/http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx
original link (dead): http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx
It explains how to compile in command line using cl.exe and choose XP toolset.
When compiling boost, before starting the build itself using b2.exe, insert all required parameters in order to choose 120_xp toolset.
How do I build boost with new Visual Studio 2013 preview?
Yes. It is possible.
Possible solutions are:
- Try build Boost 1.53: not too fresh, but for some strange reason it builds just fine.
- If you really-really need Boost 1.54 (new Log library looks good :) ), try to apply this diff-patch to your Boost 1.54 distributive. It is best suited for revision 84920, but you can try any other too. Note that I am not author of this patch.
- Try to get latest revision with Subversion:
svn co http://svn.boost.org/svn/boost/trunk boost-trunk
. For a time when you reading this, issue can be already fixed by contributors.
EDIT: 26 aug 2013
Looks like boost folks fixed these issues. Latest SVN revision svn co http://svn.boost.org/svn/boost/trunk boost-trunk
builds fine. Thanks to them!
EDIT: 4 dec 2013
Quote from TheArtTrooper comment:
Boost 1.55.0 builds with the Visual Studio 2013 RTM without any
additional patches
Happy boosting!
How to create a vcproj to build boost 1.54 (Visual Studio 2013)
Building boost basically is quite simple.
These guide lines describe the process:
http://www.boost.org/doc/libs/1_54_0/more/getting_started/windows.html
http://www.boost.org/boost-build2/doc/html/bbv2/overview/invocation.html
Basically what you have to do is,
- Open a VisualStudio Command Prompt
Change the current dir to your boost directory i.e:
CD c:\myStuff\boost\boost_1_54_0\
Call boptstrap:
bootstrap
start build i.e:
bjam address-model=32
This is the process that worked for me with VC2010. It should work with 2013 as well. If you have problems specific to VC2013, please report the error messages you receive in detail.
How can I get the boost/Serialization-libs compiled in Visual Studio 2013?
While most components of boost are header-only, a couple of them depend on separately compiled libraries. To compile them just follow the instructions here. After having them compiled, you can include the header files as usual, the linker picks the required libraries automatically.
how to deploy simple boost program written in visual studio on other computers
Boost needs to be recompiled to match your new runtime library setting. The filename of the Boost library indicates the settings it was linked with, and the Boost auto-link code automatically updated the needed filename to match your new settings. In this case, it quite accurately indicates that you need a Boost lib which was compiled with a static stdlib link.
Related Topics
Incomplete Class Usage in Template
How to Link Google Protobuf Libraries via Cmake on Linux
Why "Not All Control Paths Return a Value" Is Warning and Not an Error
Initializing a Ublas Vector from a C Array
What Happens When a Function That Returns an Object Ends Without a Return Statement
Qsqldatabase: Qmysql Driver Not Loaded on Ubuntu 15.04 64Bits
Undefined Symbol on a Template Operator Overloading Function
Speed Difference Between If-Else and Ternary Operator in C...
How to Use C++14 Features When Building Qmake Projects
Qmake: How to Remove Compiler Flag for a Certain Project, Without Changing Qmake.Conf
How to Omit the Double-Braces for Std::Array in C++14
Want to Efficiently Overcome Mismatch Between Key Types in a Map in Boost.Interprocess Shared Memory