libs/regex/example/grep/grep.cpp: g++ 4.0 compilation error

Test regex/grep is failing due to a compilation error with g++ 4.0: ../libs/regex/example/grep/grep.cpp: In function 'int main(int, const char**)': ../libs/regex/example/grep/grep.cpp:130: error: invalid conversion from 'const char**' to 'char**' ../libs/regex/example/grep/grep.cpp:130: error: initializing argument 2 of 'boost::program_options::basic_command_line_parser<charT>::basic_command_line_parser(int, charT**) [with charT = char]' This is due to "main" being declared as: int main(int argc, const char * argv[]) ... phil -- change name before "@" to "phil" for email

Phil Richards wrote:
Test regex/grep is failing due to a compilation error with g++ 4.0:
../libs/regex/example/grep/grep.cpp: In function 'int main(int, const char**)': ../libs/regex/example/grep/grep.cpp:130: error: invalid conversion from 'const char**' to 'char**' ../libs/regex/example/grep/grep.cpp:130: error: initializing argument 2 of
'boost::program_options::basic_command_line_parser<charT>::basic_command_line_parser(int,
charT**) [with charT = char]'
This is due to "main" being declared as: int main(int argc, const char * argv[])
And to clarify: the C++ standard says the second argument to main should be char* argv[] Without 'const'. - Volodya
participants (3)
-
John Maddock
-
Phil Richards
-
Vladimir Prus