Boost C++ Libraries: Ticket #6439: convert.cpp does not compile when defining BOOST_NO_STD_LOCALE https://svn.boost.org/trac10/ticket/6439 <p> The reason for this build failure is that BOOST_USE_FACET is not defined when compiling with BOOST_NO_STD_LOCALE. The two methods can easily be excluded for NO_STD_LOCALE. See attached patch. The patch is against trunk as of today. </p> <p> gcc.compile.c++ bin.v2/libs/program_options/build/gcc-4.6.1/release/threading-multi/convert.o libs/program_options/src/convert.cpp: In Funktion »std::wstring boost::from_local_8_bit(const string&amp;)«: libs/program_options/src/convert.cpp:134:53: Fehler: expected primary-expression before »,« token libs/program_options/src/convert.cpp:134:63: Fehler: »BOOST_USE_FACET« wurde in diesem Gültigkeitsbereich nicht definiert libs/program_options/src/convert.cpp: In Funktion »std::string boost::to_local_8_bit(const wstring&amp;)«: libs/program_options/src/convert.cpp:142:51: Fehler: expected primary-expression before »,« token libs/program_options/src/convert.cpp:142:61: Fehler: »BOOST_USE_FACET« wurde in diesem Gültigkeitsbereich nicht definiert libs/program_options/src/convert.cpp:143:5: Warnung: Kontrollfluss erreicht Ende von Nicht-void-Funktion [-Wreturn-type] libs/program_options/src/convert.cpp: In Funktion »std::wstring boost::from_local_8_bit(const string&amp;)«: libs/program_options/src/convert.cpp:135:5: Warnung: Kontrollfluss erreicht Ende von Nicht-void-Funktion [-Wreturn-type] </p> <blockquote> <p> "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -DBOOST_NO_STD_LOCALE -DBOOST_ALL_NO_LIB=1 -DBOOST_PROGRAM_OPTIONS_DYN_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/program_options/build/gcc-4.6.1/release/threading-multi/convert.o" "libs/program_options/src/convert.cpp" </p> </blockquote> <p> (The reason for BOOST_NO_STD_LOCALE is the libstdc++ in my target system that throws an exceptions for std::locale(""); 8-((( ) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6439 Trac 1.4.3 leutloff@… Mon, 23 Jan 2012 20:58:28 GMT attachment set https://svn.boost.org/trac10/ticket/6439 https://svn.boost.org/trac10/ticket/6439 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_po_compile_w_NO_STD_LOCALE.patch</span> </li> </ul> Ticket leutloff@… Tue, 03 Apr 2012 12:48:38 GMT attachment set https://svn.boost.org/trac10/ticket/6439 https://svn.boost.org/trac10/ticket/6439 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_po_compile_w_NO_STD_LOCALE_v2.patch</span> </li> </ul> <p> Reworked patch </p> Ticket leutloff@… Tue, 03 Apr 2012 12:55:16 GMT <link>https://svn.boost.org/trac10/ticket/6439#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6439#comment:1</guid> <description> <p> I have reworked the patch. On systems without std locale the conversion is now a simple type conversion from string to wstring and vice. The character set is NOT converted. It is not perfect, but what is perfect on a system without a working std locale ... The first patch can be removed from this ticket. The new one ends with _v2.patch. </p> </description> <category>Ticket</category> </item> </channel> </rss>