Opened 11 years ago
Last modified 11 years ago
#6439 new Bugs
convert.cpp does not compile when defining BOOST_NO_STD_LOCALE
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost 1.48.0 | Severity: | Regression |
Keywords: | Cc: |
Description
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.
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&)«: 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&)«: 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&)«: libs/program_options/src/convert.cpp:135:5: Warnung: Kontrollfluss erreicht Ende von Nicht-void-Funktion [-Wreturn-type]
"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"
(The reason for BOOST_NO_STD_LOCALE is the libstdc++ in my target system that throws an exceptions for std::locale(""); 8-((( )
Attachments (2)
Change History (3)
by , 11 years ago
Attachment: | boost_po_compile_w_NO_STD_LOCALE.patch added |
---|
by , 11 years ago
Attachment: | boost_po_compile_w_NO_STD_LOCALE_v2.patch added |
---|
comment:1 by , 11 years ago
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.
Reworked patch