Boost C++ Libraries: Ticket #6851: 64bit build error on Solaris with gcc 4.4.5 and ICU https://svn.boost.org/trac10/ticket/6851 <p> Hi, </p> <p> When doing a 64bit build of boost on Solaris with gcc 4.4.5, we're getting the following error: </p> <pre class="wiki"> "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthreads -m64 -DBOOST_ALL_NO_LIB=1 -DBOOST_LOCALE_NO_POSIX_BACKEND=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/locale/build/gcc-4.4.5/release/address-model-64/link-static/threading-multi/icu/formatter.o" "libs/locale/src/icu/formatter.cpp" libs/locale/src/icu/formatter.cpp: In member function 'virtual std::basic_string&lt;_CharT, std::char_traits&lt;_CharT&gt;, std::allocator&lt;_CharT&gt; &gt; boost::locale::impl_icu::number_format&lt;CharType&gt;::format(boost::int64_t, size_t&amp;) const': libs/locale/src/icu/formatter.cpp:61: error: call of overloaded 'format(boost::int64_t&amp;, icu_49::UnicodeString&amp;)' is ambiguous /ec/include/unicode/numfmt.h:317: note: candidates are: icu_49::UnicodeString&amp; icu_49::NumberFormat::format(double, icu_49::UnicodeString&amp;) const /ec/include/unicode/numfmt.h:330: note: icu_49::UnicodeString&amp; icu_49::NumberFormat::format(int32_t, icu_49::UnicodeString&amp;) const /ec/include/unicode/numfmt.h:343: note: icu_49::UnicodeString&amp; icu_49::NumberFormat::format(int64_t, icu_49::UnicodeString&amp;) const </pre><p> This is doing a 64bit build with ICU version v49.1.1 (although the same issue happens with 4.8.1.1). </p> <p> There are multiple definitions of of the formatter:format method, as can be seen here: </p> <p> <a class="ext-link" href="http://svn.boost.org/svn/boost/trunk/libs/locale/src/icu/formatter.cpp"><span class="icon">​</span>http://svn.boost.org/svn/boost/trunk/libs/locale/src/icu/formatter.cpp</a> </p> <p> This is the 32bit function definition with the call to icu_fmt: </p> <pre class="wiki">virtual string_type format(int32_t value,size_t &amp;code_points) const icu_fmt_-&gt;format(::int32_t(value),tmp); </pre><p> However the 64bit one doesn't make a cast: </p> <pre class="wiki">virtual string_type format(int64_t value,size_t &amp;code_points) const icu_fmt_-&gt;format(value,tmp); </pre><p> Fixing this with the following patch fixes the build: </p> <pre class="wiki">diff -ruN boost_1_49_0.orig/libs/locale/src/icu/formatter.cpp boost_1_49_0/libs/locale/src/icu/formatter.cpp --- boost_1_49_0.orig/libs/locale/src/icu/formatter.cpp 2011-07-12 14:57:36.000000000 +0100 +++ boost_1_49_0/libs/locale/src/icu/formatter.cpp 2012-05-01 14:27:54.000000000 +0100 @@ -58,7 +58,7 @@ virtual string_type format(int64_t value,size_t &amp;code_points) const { icu::UnicodeString tmp; - icu_fmt_-&gt;format(value,tmp); + icu_fmt_-&gt;format(::int64_t(value),tmp); code_points=tmp.countChar32(); return cvt_.std(tmp); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6851 Trac 1.4.3 anonymous Wed, 04 Jul 2012 22:03:28 GMT <link>https://svn.boost.org/trac10/ticket/6851#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6851#comment:1</guid> <description> <p> I also observe this in boost 1.49/1.50 on Solaris when compiling under Solaris Studio 12.3. The above patch fixes it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 03 Jan 2013 17:51:29 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/6851#comment:2 https://svn.boost.org/trac10/ticket/6851#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Artyom Beilis</span> </li> <li><strong>component</strong> <span class="trac-field-old">Building Boost</span> → <span class="trac-field-new">locale</span> </li> </ul> Ticket Artyom Beilis Fri, 04 Jan 2013 14:22:16 GMT status changed https://svn.boost.org/trac10/ticket/6851#comment:3 https://svn.boost.org/trac10/ticket/6851#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> I can't use ::int64_t as it not defined on all compilers for example on some platforms (Windows) we do not have stdint.h so we do not have int64_t in the global namespace. </p> <p> I'll take a look on it. </p> Ticket Artyom Beilis Thu, 13 Jul 2017 14:12:56 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6851#comment:4 https://svn.boost.org/trac10/ticket/6851#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> fixed in dev branch </p> Ticket