Boost C++ Libraries: Ticket #6147: message_queue sample fails to compile in 32-bit https://svn.boost.org/trac10/ticket/6147 <p> Just upgraded to 1.48. </p> <p> On OS X I compile the sample program with: gcc -I &lt;blah path to boost&gt;/include -arch i386 main.cpp </p> <p> and it fails with "....boost/interprocess/ipc/message_queue.hpp:330: error: no matching function for call to ‘get_rounded_size(long unsigned int, const unsigned int&amp;)’" </p> <p> It's the MQ creation line that fails. If I build for x64, it compiles successfully. The source is: </p> <p> #define BOOST_DATE_TIME_NO_LIB #include &lt;boost/interprocess/ipc/message_queue.hpp&gt; #include &lt;iostream&gt; #include &lt;vector&gt; </p> <p> using namespace boost::interprocess; </p> <p> int main () { </p> <blockquote> <p> try{ </p> <blockquote> <p> <em>Erase previous message queue message_queue::remove("message_queue"); </em></p> </blockquote> </blockquote> <p> </p> <blockquote> <blockquote> <p> <em>Create a message_queue. message_queue mq (create_only </em>only create </p> <blockquote> <p> ,"message_queue" <em>name ,100 </em>max message number ,sizeof(int) <em>max message size ); </em></p> </blockquote> </blockquote> </blockquote> <p> </p> <blockquote> <blockquote> <p> <em>Send 100 numbers for(int i = 0; i &lt; 100; ++i){ </em></p> <blockquote> <p> mq.send(&amp;i, sizeof(i), 0); </p> </blockquote> <p> } </p> </blockquote> <p> } catch(interprocess_exception &amp;ex){ </p> <blockquote> <p> std::cout &lt;&lt; ex.what() &lt;&lt; std::endl; return 1; </p> </blockquote> <p> } </p> </blockquote> <p> </p> <blockquote> <p> return 0; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6147 Trac 1.4.3 Graham Perks <graham@…> Fri, 18 Nov 2011 19:42:20 GMT <link>https://svn.boost.org/trac10/ticket/6147#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:1</guid> <description> <p> Retry code formatting. It's the sample from the boost docs. </p> <pre class="wiki"> #define BOOST_DATE_TIME_NO_LIB #include &lt;boost/interprocess/ipc/message_queue.hpp&gt; #include &lt;iostream&gt; #include &lt;vector&gt; using namespace boost::interprocess; int main () { try{ //Erase previous message queue message_queue::remove("message_queue"); //Create a message_queue. message_queue mq (create_only //only create ,"message_queue" //name ,100 //max message number ,sizeof(int) //max message size ); //Send 100 numbers for(int i = 0; i &lt; 100; ++i){ mq.send(&amp;i, sizeof(i), 0); } } catch(interprocess_exception &amp;ex){ std::cout &lt;&lt; ex.what() &lt;&lt; std::endl; return 1; } return 0; } </pre> </description> <category>Ticket</category> </item> <item> <author>Graham Perks <graham@…></author> <pubDate>Fri, 18 Nov 2011 19:47:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6147#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:2</guid> <description> <p> If anyone has a workaround for this, it would be much appreciated. </p> </description> <category>Ticket</category> </item> <item> <author>Graham Perks <graham@…></author> <pubDate>Fri, 18 Nov 2011 19:58:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6147#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:3</guid> <description> <p> I was able to workaround this by adding this code before including the boost headers. It adds a second type to the get_rounded_size template. </p> <pre class="wiki">namespace boost { namespace interprocess { namespace ipcdetail { //Rounds "orig_size" by excess to round_to bytes template&lt;class SizeType, class ST2&gt; inline SizeType get_rounded_size(SizeType orig_size, ST2 round_to) { return ((orig_size-1)/round_to+1)*round_to; } } } } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Wed, 18 Jan 2012 21:08:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6147#comment:4 https://svn.boost.org/trac10/ticket/6147#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</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 trunk and release branches adding </p> <p> #include &lt;boost/interprocess/detail/utilities.hpp&gt; </p> <p> to message queue header. </p> Ticket moala@… Fri, 31 Aug 2012 15:44:04 GMT status, version changed; resolution deleted https://svn.boost.org/trac10/ticket/6147#comment:5 https://svn.boost.org/trac10/ticket/6147#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.48.0</span> → <span class="trac-field-new">Boost 1.50.0</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Still not fixed in i386 GCC 4.2 xcode 3.2.6 (only works in x86_64) even with this </p> <p> #include &lt;boost/interprocess/detail/utilities.hpp&gt; </p> <p> inclusion in message_queue.hpp in boost 1.50 (macports) (with Mac OS X 10.6 SDK / deployment target 10.5). </p> <p> Graham Perks's workaround allows compiling. </p> Ticket Ion Gaztañaga Sun, 10 Feb 2013 21:03:47 GMT <link>https://svn.boost.org/trac10/ticket/6147#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:6</guid> <description> <p> I successfully compiled your test using trunk code in Mac OS 10.6.2 with GCC: </p> <p> i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664) </p> <p> can you check the bug is fixed? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Tue, 15 Oct 2013 20:39:32 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6147#comment:7 https://svn.boost.org/trac10/ticket/6147#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> No news from the reporter so I'm closing the issue. </p> Ticket darthpjb@… Mon, 25 Aug 2014 00:26:41 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/6147#comment:8 https://svn.boost.org/trac10/ticket/6147#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">worksforme</span> </li> </ul> <p> I can confirm that this issue is still relevant (as mentioned by moala) in boost 1_56_0. </p> <p> 32bit Intel builds for 10.7.5 fail as above on LLVM GCC 4.2 - The mentioned workaround did indeed solve the problem for me also. </p> <p> Note that I am static-linking boost, and forcing the compiler to GNU99 dialect. These may be related? </p> <p> If needed I may be able to create a reproducing project. </p> Ticket darthpjb@… Tue, 26 Aug 2014 18:34:07 GMT <link>https://svn.boost.org/trac10/ticket/6147#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:9</guid> <description> <p> I can now further confirm the issue is also apparent on I386 builds using LLVM GCC 5.1, for the 10.9 SDK, Xcode 5.1.1. </p> <p> It would seem this does actively apply to the most recent LLVM compilers, across the full range of Mac OSX builds. As long as the target architecture is 32bit. </p> </description> <category>Ticket</category> </item> <item> <author>darthpjb@…</author> <pubDate>Wed, 27 Aug 2014 14:45:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6147#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:10</guid> <description> <p> Further Confirmation: The issue is also present on OSX 10.5.8, Xcode 3.1.4, Using Apple GCC 4.0 </p> <p> Graham Perk's fix does, once again, solve the issue. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 27 Aug 2014 15:53:33 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/6147#comment:11 https://svn.boost.org/trac10/ticket/6147#comment:11 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.50.0</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> Ticket darthpjb@… Wed, 27 Aug 2014 15:53:57 GMT cc set https://svn.boost.org/trac10/ticket/6147#comment:12 https://svn.boost.org/trac10/ticket/6147#comment:12 <ul> <li><strong>cc</strong> <span class="trac-author">darthpjb@…</span> added </li> </ul> Ticket Ion Gaztañaga Fri, 29 Aug 2014 23:57:01 GMT <link>https://svn.boost.org/trac10/ticket/6147#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:13</guid> <description> <p> Without access to the platform, I can't know where the problem lies. However, one alternative could be specifying the template type in get_rounded_size. That is: </p> <p> replace "get_rounded_size(a, b)" calls with "get_rounded_size&lt;size_type&gt;(a, b)". </p> <p> Please let me know if this fixes the problem </p> </description> <category>Ticket</category> </item> <item> <author>bbaldino@…</author> <pubDate>Thu, 16 Oct 2014 18:33:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6147#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6147#comment:14</guid> <description> <p> For what it's worth, I had this same problem on OSX (with boost 1.56) and this workaround got things compiling. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Wed, 22 Oct 2014 10:48:06 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6147#comment:15 https://svn.boost.org/trac10/ticket/6147#comment:15 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</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 Boost 1.57 Beta. </p> Ticket