Boost C++ Libraries: Ticket #6790: program_options regression in 1.49.0? https://svn.boost.org/trac10/ticket/6790 <p> Since 1.49, bitcoin unable to compile with error: </p> <pre class="wiki">g++ -c -pthread -Wextra -Wno-sign-compare -Wno-char-subscripts \ -Wno-invalid-offsetof -Wformat -Wformat-security -g -DNOPCH \ -I/home/shahid/shares/install/linux/bitcoin/bitcoin \ /src/bitcoin-0.6.0-linux/src/src -DUSE_UPNP=1 -DUSE_SSL \ -fno-stack-protector -fstack-protector-all -Wstack-protector \ -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -march=native -O3 \ -pipe -ftree-vectorize -msse -msse2 -msse3 -MMD -o obj/util.o \ util.cpp In file included from util.cpp:8:0: /usr/include/boost/program_options/detail/config_file.hpp: In \ instantiation of «bool boost::program_options::detail::basic_config_file_iterator&lt;charT&gt;::getline(std::string&amp;) [with charT = char; std::string = std::basic_string&lt;char&gt;]»: util.cpp:1251:1: required from here /usr/include/boost/program_options/detail/config_file.hpp:163:13: error: «to_internal» was not declared in this scope, and no declarations were found by argument- dependent lookup at the point of instantiation [-fpermissive] In file included from /usr/include/boost/program_options/detail/parsers.hpp:9:0, from /usr/include/boost/program_options/parsers.hpp:265, from util.cpp:9: /usr/include/boost/program_options/detail/convert.hpp:75:34: замечание: «template&lt;class T&gt; std::vector&lt;std::basic_string&lt;char&gt; &gt; boost::program_options::to_internal(const std::vector&lt;T&gt;&amp;)» declared here, later in the translation unit util.cpp: In function «void ShrinkDebugFile()»: util.cpp:963:41: warning: ignoring return value of «size_t fwrite(const void*, size_t, size_t, FILE*)», declared with attribute warn_unused_result [-Wunused-result] make: *** [obj/util.o] Error 1 </pre><p> Steps to reproduce: </p> <pre class="wiki">wget bitcoin-0.6.0 from http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.6.0/bitcoin-0.6.0-linux.tar.gz/download tar xf bitcoin-0.6.0-linux.tar.gz cd bitcoin-0.6.0-linux/src/src make -f makefile.unix bitcoind </pre><p> Steps to avoid error: </p> <ul><li>Error can be avoided by removing #if around #include &lt;.../convert.hpp&gt; in /usr/include/boost/program_options/detail/config_file.hpp </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6790 Trac 1.4.3 Konstantin Nikiforov <helllamer@…> Sat, 14 Apr 2012 13:33:45 GMT cc set https://svn.boost.org/trac10/ticket/6790#comment:1 https://svn.boost.org/trac10/ticket/6790#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">helllamer@…</span> added </li> </ul> <p> (And adding -DBOOST_FILESYSTEM_VERSION=2 does not help.) </p> Ticket Steve Robbins <smr@…> Fri, 04 May 2012 23:46:22 GMT <link>https://svn.boost.org/trac10/ticket/6790#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6790#comment:2</guid> <description> <p> Konstantin: does this happen only with gcc 4.7 (as suggested by <a class="ext-link" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=671409"><span class="icon">​</span>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=671409</a>) or generally? If the latter, what architecture? </p> <p> I can successfully build using gcc 4.6 on Debian/amd64. </p> </description> <category>Ticket</category> </item> <item> <author>Konstantin Nikiforov <helllamer@…></author> <pubDate>Sat, 05 May 2012 07:04:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6790#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6790#comment:3</guid> <description> <p> Hmm, looks like, error can be fixed using -fpermissive in gcc-4.7. </p> <pre class="wiki">g++ -c -pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat -Wformat-security -DNOPCH -I/home/shahid/shares/install/linux/pkgbuild/bitcoin/src/bitcoin-0.6.0-linux/src/src -DUSE_UPNP=1 -DUSE_SSL -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -march=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -ftree-vectorize -fpermissive -MMD -o obj/util.o util.cpp In file included from /usr/include/boost/program_options/detail/parsers.hpp:9:0, from /usr/include/boost/program_options/parsers.hpp:265, from util.cpp:9: /usr/include/boost/program_options/detail/config_file.hpp: In instantiation of «bool boost::program_options::detail::basic_config_file_iterator&lt;charT&gt;::getline(std::string&amp;) [with charT = char; std::string = std::basic_string&lt;char&gt;]»: util.cpp:1251:1: required from here /usr/include/boost/program_options/detail/convert.hpp:75:34: замечание: «template&lt;class T&gt; std::vector&lt;std::basic_string&lt;char&gt; &gt; boost::program_options::to_internal(const std::vector&lt;T&gt;&amp;)» declared here, later in the translation unit util.cpp: В функции «void ShrinkDebugFile()»: util.cpp:963:41: предупреждение: ignoring return value of «size_t fwrite(const void*, size_t, size_t, FILE*)», declared with attribute warn_unused_result [-Wunused-result] </pre><p> -fpermissive + gcc-4.7 = no error, only warnings. </p> </description> <category>Ticket</category> </item> <item> <author>Konstantin Nikiforov <helllamer@…></author> <pubDate>Sat, 05 May 2012 07:06:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6790#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6790#comment:4</guid> <description> <p> In gcc-4.6 error is not reproduceable. </p> <p> x86_64. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Sat, 05 May 2012 07:17:42 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6790#comment:5 https://svn.boost.org/trac10/ticket/6790#comment:5 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/78331" title="Include necessary header, don't rely on two-phase lookup not being ...">[78331]</a>) Include necessary header, don't rely on two-phase lookup not being there. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6790" title="#6790: Bugs: program_options regression in 1.49.0? (closed: fixed)">#6790</a>. </p> Ticket