A error when using long option description, program_options library
This runtime error only occurs when debug version, the release version has no such problem. The long option description can not be printed. My platform is vc7.1+stlport 4.62+boost 1.33, I also define the macro _STLP_DEBUG and BOOST_LIB_DIAGNOSTIC. Some extraction of my code: operatoins.add_options() ("difference,d", "Get all the word of mine, origin file, my file, output file") ("replace,r", "Replace the wrong pinyin with the right(delete maybe wrong chongma)" ", right file, origin file, new file") ("remove", po::value<string>(), "delete the word specified by regex expression") ("merge,m", "merge the files specified") ("regex", "match regex") ("files,f", po::value< vector<string> >(), "input file"); when print "Get all the word of mine, origin file, my file, output ", a runtime error occurs, the program terminates. Although I can give the debug version a short description and the release version a long description, it is boring. The error occur in the code call format_one()/format_description/format_paragraph The error code is line 361, options_description.cpp: if (line_begin + (line_length - indent) > par_end) { line_end = par_end; } else { line_end = line_begin + (line_length - indent); }
??? wrote:
This runtime error only occurs when debug version, the release version has no such problem. The long option description can not be printed.
My platform is vc7.1+stlport 4.62+boost 1.33, I also define the macro _STLP_DEBUG and BOOST_LIB_DIAGNOSTIC.
Some extraction of my code: operatoins.add_options() ("difference,d", "Get all the word of mine, origin file, my file, output file")
.......
when print "Get all the word of mine, origin file, my file, output ", a runtime error occurs, the program terminates.
Please provide the minimal complete program that reproduces this, and I'll try to debug this. - Volodya
I change the demo code of program_option first.cpp as below, when I compiled
with
cl /MDd /EHsc /D "BOOST_ANY_DYN_LINK" /D "_STLP_DEBUG" first.cpp
when run "first --help", a runtime error will occur.
when cl /MD /EHsc /D "BOOST_ANY_DYN_LINK" first.cpp, there is no runtime
error running "first --help".
----------------------------------------------------------------------------
-------------------
#include
??? wrote:
This runtime error only occurs when debug version, the release version has no such problem. The long option description can not be printed.
My platform is vc7.1+stlport 4.62+boost 1.33, I also define the macro _STLP_DEBUG and BOOST_LIB_DIAGNOSTIC.
Some extraction of my code: operatoins.add_options() ("difference,d", "Get all the word of mine, origin file, my file, output file")
.......
when print "Get all the word of mine, origin file, my file, output ", a runtime error occurs, the program terminates.
Please provide the minimal complete program that reproduces this, and I'll try to debug this.
- Volodya
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Huifeng Shen
-
Vladimir Prus
-
沈慧峰