Boost C++ Libraries: Ticket #6779: Scoped enums break linking compatibility between C++98 and C++11 https://svn.boost.org/trac10/ticket/6779 <p> The compiled part of Boost.<a class="missing wiki">FileSystem</a> v3 uses scoped enums in its interface. This is the case with the copy_file function. This creates linking incompatibilities if Boost is compiled in C++98 and user's code in C++11 mode because in the former case scoped enums are emulated and thus generate a different name in the decorated function names. It's worth noting that typically binary distributions of Boost in Linux are built in C++98 mode, which complicates linking C++11 user's code. </p> <p> The suggested fix is to use either integers or traditional enums in the private library interface. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6779 Trac 1.4.3 Andrey Semashev Mon, 01 Apr 2013 09:06:02 GMT <link>https://svn.boost.org/trac10/ticket/6779#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:1</guid> <description> <p> Any news on this problem? It still persists in 1.53. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 10 May 2013 21:14:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:2</guid> <description> <p> Indeed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 10 May 2013 21:38:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:3</guid> <description> <p> I don't understand. Are you suggesting that boost libraries can not use any C++11 specific feature on their interface when compiling with a C++11 compiler? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Fri, 10 May 2013 21:43:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6779#comment:3" title="Comment 3">viboes</a>: </p> <blockquote class="citation"> <p> I don't understand. Are you suggesting that boost libraries can not use any C++11 specific feature on their interface when compiling with a C++11 compiler? </p> </blockquote> <p> Yes, at least when the platform has different ABI for C++03 and C++11 for that feature. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 11 May 2013 06:36:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6779#comment:4" title="Comment 4">andysem</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6779#comment:3" title="Comment 3">viboes</a>: </p> <blockquote class="citation"> <p> I don't understand. Are you suggesting that boost libraries can not use any C++11 specific feature on their interface when compiling with a C++11 compiler? </p> </blockquote> <p> Yes, at least when the platform has different ABI for C++03 and C++11 for that feature. </p> </blockquote> <p> It would be worth sharing on the ML the list the features that are in the same case. Behind scoped enums, which others fall in this cathegory? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Mon, 13 May 2013 11:35:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6779#comment:5" title="Comment 5">viboes</a>: </p> <blockquote class="citation"> <p> It would be worth sharing on the ML the list the features that are in the same case. Behind scoped enums, which others fall in this cathegory? </p> </blockquote> <p> I don't have a complete list of C++11 features that break the ABI. But I presume any C++11-specific feature that affects types and function signatures should be avoided in binary interfaces. This includes scoped enums and rvalue references at the very least. noexcept doesn't affect function signatures, so it should be safe. constexpr should be inline, so it should not pose any problems, too. </p> <p> Also one should be very careful with STL types that are present in binary interfaces. Obviously, if std::tuple is present in a function signature, then this function cannot be called from a C++03 program. There may be less obvious examples, such as container iterator types, if they are different for C++03 and C++11. </p> </description> <category>Ticket</category> </item> <item> <author>chrisstankevitz@…</author> <pubDate>Fri, 06 Sep 2013 22:17:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:7</guid> <description> <p> It seems boost::signals2 is also affected by this. Consider this function definition: </p> <p> void f(boost::signals2::signal&lt;void(const std::string&amp;)&gt;::slot_type) </p> <p> c++98 signature: f(boost::signals2::slot1&lt;void, std::string const&amp;) </p> <p> c++0x signature: f(boost::signals2::slot&lt;void (std::string const&amp;)) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 07 Sep 2013 17:27:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:8</guid> <description> <p> Boost.Signals2 does not have a compiled binary, so this is localized to the user's code. In general Boost libraries don't guarantee ABI stability for different compiler configurations. The problem with Boost.Filesystem is a special case because it has a compiled binary, which is supplied by OS distribution vendors. </p> </description> <category>Ticket</category> </item> <item> <author>ippattume@…</author> <pubDate>Thu, 19 Dec 2013 12:50:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:9</guid> <description> <p> I've had no problem with boost 1.55 until today's update to 1.55.0-3. I've had to downgrade to 1.55.0-2 to make my project link correctly. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Fri, 24 Oct 2014 16:02:25 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/6779#comment:10 https://svn.boost.org/trac10/ticket/6779#comment:10 <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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6124" title="#6124: Bugs: Problem with copy_file in 1.47 (closed: fixed)">#6124</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6779" title="#6779: Bugs: Scoped enums break linking compatibility between C++98 and C++11 (closed: fixed)">#6779</a>, and <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10038" title="#10038: Bugs: filesystem library with -std=c++11 causes undefined reference to copy_file (closed: fixed)">#10038</a> are all the same problem. The private library interface has been changed to use a plain-old C++03 enum. This is the fix suggested by Andy in 6779. </p> <p> The fix was too late for 1.57 beta 1, but should be in the final 1.57 release. </p> <p> Thanks for your patience, </p> <p> --Beman </p> Ticket daira@… Fri, 09 Jan 2015 23:25:43 GMT <link>https://svn.boost.org/trac10/ticket/6779#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:11</guid> <description> <p> I am still getting this error even though I have tried building against boost 1.54 and 1.57. I have to compile using C++11. Is there any other known workaround? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 10 Jan 2015 00:07:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:12</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6779#comment:11" title="Comment 11">daira@…</a>: </p> <blockquote class="citation"> <p> I am still getting this error even though I have tried building against boost 1.54 and 1.57. I have to compile using C++11. Is there any other known workaround? </p> </blockquote> <p> Feel free to reopen the ticket with the error you get for 1.57. </p> </description> <category>Ticket</category> </item> <item> <author>daira@…</author> <pubDate>Sat, 10 Jan 2015 03:52:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6779#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6779#comment:13</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6779#comment:12" title="Comment 12">andysem</a>: </p> <blockquote class="citation"> <p> Feel free to reopen the ticket with the error you get for 1.57. </p> </blockquote> <p> False alarm; due to a build system problem, I was actually compiling against a different version of boost than I thought. It does seem to be fixed with 1.57. </p> </description> <category>Ticket</category> </item> </channel> </rss>