Hi,
I have a few questions about Boost.ProgramOptions pertaining to parsing
an argv that is of wchar_t data type. The first thing that isn't clear
from the examples is whether it's possible at all. The second thing
that isn't clear is how to do it and store string values in std::wstring
variables.
Here are the specifics:
1) How do you use program_options with an argv argument that is a
wchar_t data type?
Like this?
variables_map vm;
store(parse_command_line(argc, argv, desc), vm);
but then the question is how do you store any of the command line values
in wstring variables?
Like this?
options_description desc("allowed options");
desc.add_options()
// First parameter describes option name/short name
// The second is parameter to option
// The third is description
("help,h", "print usage message")
("validate,v", value(&strFile), "validate xml file");
// strFile is a wstring
Well that doesn't work.
2) I am getting 3 link errors when trying the above:
ToolsTest.obj : error LNK2019: unresolved external symbol "void __cdecl
boost::program_options::store(class
boost::program_options::basic_parsed_options<unsigned short> const
&,class boost::program_options::variables_map &)"
(?store@program_options@boost@@YAXABV?$basic_parsed_options@G@12@AAVvari
ables_map@12@@Z) referenced in function _main
ToolsTest.obj : error LNK2019: unresolved external symbol "public:
__thiscall boost::program_options::basic_parsed_options<unsigned
short>::basic_parsed_options<unsigned short>(class
boost::program_options::basic_parsed_options<char> const &)"
(??0?$basic_parsed_options@G@program_options@boost@@QAE@ABV?$basic_parse
d_options@D@12@@Z) referenced in function "public: class
boost::program_options::basic_parsed_options<unsigned short> __thiscall
boost::program_options::basic_command_line_parser<unsigned
short>::run(void)const "
(?run@?$basic_command_line_parser@G@program_options@boost@@QBE?AV?$basic
_parsed_options@G@23@XZ)
ToolsTest.obj : error LNK2019: unresolved external symbol "class
std::basic_string __cdecl boost::program_options::to_internal(class
std::basic_string const &)"
(?to_internal@program_options@boost@@YA?AV?$basic_string@DU?$char_traits
@D@std@@V?$allocator@D@2@@std@@ABV?$basic_string@GU?$char_traits@G@std@@
V?$allocator@G@2@@4@@Z) referenced in function "class std::vector,class std::allocator > > __cdecl
boost::program_options::to_internal >(class std::vector,class std::allocator > > const &)"
(??$to_internal@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@
@std@@@program_options@boost@@YA?AV?$vector@V?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_
traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@ABV?$vector@V?$basic_strin
g@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@V?$allocator@V?$basic_st
ring@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@2@@3@@Z)
Thanks for any help here,
Elisha Berns
e.berns@computer.org
tel. (310) 556 - 8332
fax (310) 556 - 2839