
Hello, I attach a patch that allows use of program_options with mingw compiler. There isn't support for utf-8 conversion - maybe it is possible to convert without use of wstring? Regards, Janusz

Janusz Piwowarski wrote:
I attach a patch that allows use of program_options with mingw compiler. There isn't support for utf-8 conversion - maybe it is possible to convert without use of wstring?
Hi Janusz, thanks for the patch! I planned to do something like that, but got swamped in other things. I have only one question: why do we need the following: - to_internal(detail::make_vector(argv+1, argv+argc))) + to_internal(detail::make_vector<charT, charT**>(argv+1, argv+argc))) Is it a bug in mingw's gcc? As for converting from/to utf8 without wstring, I guess it's possible, but outside program_options. If wchar_t is not really supported, then: 1. You can't use wide parsers 2. You can't pass wchar_t to program_options So, essentially, it's only possible to use some external wchar_t -> utf-8 converter and pass the resulting 8-bit string to program_options. Thanks, Volodya

Vladimir Prus wrote: [...]
I have only one question: why do we need the following:
- to_internal(detail::make_vector(argv+1, argv+argc))) + to_internal(detail::make_vector<charT, charT**>(argv+1, argv+argc)))
Is it a bug in mingw's gcc?
I've got errors like: D:/sources/boost/boost/program_options/detail/parsers.hpp: In constructor `boost::program_options::basic_command_line_parser<charT>::basic_command_lin e_parser(int, charT**) [with charT = char]': ../../../libs/program_options/example/multiple_sources.cpp:72: instantiated from here D:/sources/boost/boost/program_options/detail/parsers.hpp:40: error: no matching function for call to `make_vector(char**, char**)' Regards, Janusz

Janusz Piwowarski wrote:
Vladimir Prus wrote: [...]
I have only one question: why do we need the following:
- to_internal(detail::make_vector(argv+1, argv+argc))) + to_internal(detail::make_vector<charT, charT**>(argv+1,
argv+argc)))
Is it a bug in mingw's gcc?
I've got errors like:
D:/sources/boost/boost/program_options/detail/parsers.hpp: In constructor `boost::program_options::basic_command_line_parser<charT>::basic_command_li n e_parser(int, charT**) [with charT = char]': ../../../libs/program_options/example/multiple_sources.cpp:72: instantiated from here D:/sources/boost/boost/program_options/detail/parsers.hpp:40: error: no matching function for call to `make_vector(char**, char**)'
Ok, looks like a bug in your gcc version (that's 3.3.1 right? I don't get problems with 3.3.3 or 3.3.4). Portable libraries are fun ;-) I've comitted your patch. Thanks for making the library work on yet another platform/compiler! - Volodya

Vladimir Prus wrote: [...]
Ok, looks like a bug in your gcc version (that's 3.3.1 right? I don't get problems with 3.3.3 or 3.3.4). Portable libraries are fun ;-)
Yes, it's 3.3.1 BTW, i successfully compile program_options library and examples with stlport 4.6.2; but my program, where i use boost::thread, don't want to link. Regards, Janusz

Janusz Piwowarski wrote:
<>I attach a patch that allows use of program_options with mingw compiler. There isn't support for utf-8 conversion - maybe it is possible to convert without use of wstring?
<>I have only one question: why do we need the following:
- to_internal(detail::make_vector(argv+1, argv+argc))) + to_internal(detail::make_vector<charT, charT**>(argv+1, argv+argc)))
Is it a bug in mingw's gcc?
I am not familiar with this issue, but GCC's C++ wide character support on MinGW is currently defunct for a few relatively silly reasons. In
Vladimir Prus wrote: particular, GCC's configure is overzealous in turning off wide character support when miscellaneous Unixisms are not present. The primary reason it doesn't work is that no one has taken the time to get it working. With any luck, this will be fixed sometime soon. Aaron W. LaFramboise
participants (3)
-
Aaron W. LaFramboise
-
Janusz Piwowarski
-
Vladimir Prus