title: How to build Boost V1.57 using the Solaris Studio 12.4 compiler
body: <p>I tried to build Boost V1.57 with the brand new Solaris Studio 12.4 compiler on the Intel Solaris V11.2 platform. I tried to post the errors on the <a href="https://community.oracle.com/community/server_%26_storage_systems/systems-development-and-management-tools/application_development_in_c__c%2B%2B__and_fortran/solaris_studio_c_c%2B%2B_fortran_compilers" rel="nofollow">OTN development forum</a> but it turned out that my simple OTN account does not let me add new posts. Hence the question to SO.</p>
  
  <p>Brief summary:
  1) Bootstrapping went OK:</p>
  
  <pre><code>cd tools/build
  ./bootstrap.sh --with-toolset=sun
  </code></pre>
  
  <p>2) Build command line (note that I put <code>b2</code> and the compiler in my <code>PATH</code>). This is a "stage" build, i.e. no installation step, just to see that all libraries can be built:</p>
  
  <pre><code>b2 -j2 --build-dir=build toolset=sun address-model=64 threading=multi variant=release  stage &gt;&amp; /tmp/boost_1_57_build.log
  </code></pre>
  
  <p>Here is a compressed list of errors:</p>
  
  <pre><code>"./boost/archive/binary_iarchive.hpp", line 57: Error: Multiple declaration for adjust_counter.
  "./boost/archive/binary_iarchive.hpp", line 57: Error: Unexpected type name "get_counter&lt;boost::archive::binary_iarchive&gt;::type" encountered.
  "./boost/archive/binary_oarchive.hpp", line 57: Error: Multiple declaration for adjust_counter.
  "./boost/archive/binary_oarchive.hpp", line 57: Error: Unexpected type name "get_counter&lt;boost::archive::binary_oarchive&gt;::type" encountered.
  "./boost/archive/detail/register_archive.hpp", line 45: Error: The function "adjust_counter" must have a prototype.
  "./boost/archive/detail/register_archive.hpp", line 46: Error: Expression must have a constant value.
  "./boost/archive/detail/register_archive.hpp", line 47: Error: Expression must have a constant value.
  "./boost/archive/detail/register_archive.hpp", line 48: Error: An integer constant expression is required within the array subscript operator.
  "./boost/archive/polymorphic_iarchive.hpp", line 170: Error: Multiple declaration for adjust_counter.
  "./boost/archive/polymorphic_iarchive.hpp", line 170: Error: Unexpected type name "get_counter&lt;boost::archive::polymorphic_iarchive&gt;::type" encountered.
  "./boost/archive/polymorphic_oarchive.hpp", line 153: Error: Multiple declaration for adjust_counter.
  "./boost/archive/polymorphic_oarchive.hpp", line 153: Error: Unexpected type name "get_counter&lt;boost::archive::polymorphic_oarchive&gt;::type" encountered.
  "./boost/archive/text_iarchive.hpp", line 136: Error: Multiple declaration for adjust_counter.
  "./boost/archive/text_iarchive.hpp", line 136: Error: Unexpected type name "get_counter&lt;boost::archive::text_iarchive&gt;::type" encountered.
  "./boost/archive/text_oarchive.hpp", line 121: Error: Multiple declaration for adjust_counter.
  "./boost/archive/text_oarchive.hpp", line 121: Error: Unexpected type name "get_counter&lt;boost::archive::text_oarchive&gt;::type" encountered.
  "./boost/archive/text_wiarchive.hpp", line 132: Error: Multiple declaration for adjust_counter.
  "./boost/archive/text_wiarchive.hpp", line 132: Error: Unexpected type name "get_counter&lt;boost::archive::text_wiarchive&gt;::type" encountered.
  "./boost/archive/text_woarchive.hpp", line 146: Error: Multiple declaration for adjust_counter.
  "./boost/archive/text_woarchive.hpp", line 146: Error: Unexpected type name "get_counter&lt;boost::archive::text_woarchive&gt;::type" encountered.
  "./boost/archive/xml_iarchive.hpp", line 146: Error: Multiple declaration for adjust_counter.
  "./boost/archive/xml_iarchive.hpp", line 146: Error: Unexpected type name "get_counter&lt;boost::archive::xml_iarchive&gt;::type" encountered.
  "./boost/archive/xml_oarchive.hpp", line 135: Error: Multiple declaration for adjust_counter.
  "./boost/archive/xml_oarchive.hpp", line 135: Error: Unexpected type name "get_counter&lt;boost::archive::xml_oarchive&gt;::type" encountered.
  "./boost/archive/xml_wiarchive.hpp", line 152: Error: Multiple declaration for adjust_counter.
  "./boost/archive/xml_wiarchive.hpp", line 152: Error: Unexpected type name "get_counter&lt;boost::archive::xml_wiarchive&gt;::type" encountered.
  "./boost/archive/xml_woarchive.hpp", line 142: Error: Multiple declaration for adjust_counter.
  "./boost/archive/xml_woarchive.hpp", line 142: Error: Unexpected type name "get_counter&lt;boost::archive::xml_woarchive&gt;::type" encountered.
  "./boost/math/cstdfloat/cstdfloat_types.hpp", line 378: Error: The type "boost::STATIC_ASSERTION_FAILURE&lt;0&gt;" is incomplete.
  "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_algo.c", line 436: Error: The function "lrand48" must have a prototype.
  "/usr/include/stdlib.h", line 113: Error: putenv(char*) was declared before with a different language.
  "libs/atomic/src/lockpool.cpp", line 74: Error: "}" expected instead of ",".
  "libs/context/src/unsupported.cpp", line 7: Error: #error "platform not supported".
  "libs/log/src/date_time_format_parser.cpp", line 399: Error: Linker scopes may not change after symbol definition.
  "libs/log/src/date_time_format_parser.cpp", line 412: Error: Linker scopes may not change after symbol definition.
  </code></pre>
  
  <p>IMO any decent C++ compiler should be able to build Boost as I can hardly imagine any serious C++ project without the Boost libraries. So I am just wondering if a Boost or Solaris Studio developer reads this and helps me with some patches...</p>
  
  <p>Many thanks for any hints!</p>