[program options] option_groups.cpp example doesn't compile

I've boost 1.55 from the debian repository. I'm trying to compile the below example of the 1.55 version (it's same as that of 1.57), but I get the following compile errors. Should I use some 'magic' compiler options, or what else is the reason for this grandious failure? $ g++ -Wall -std=gnu++11 option_groups.cpp -lboost_program_options option_groups.cpp: In function ‘int main(int, char**)’: option_groups.cpp:44:46: error: ‘class boost::program_options::typed_value<std::basic_string<char>, char>’ has no member named ‘implicit’ ("help-module", value<string>()->implicit(), ^ option_groups.cpp:96:11: error: reference to ‘exception’ is ambiguous catch(exception& e) { ^ In file included from /usr/include/c++/4.9/new:40:0, from /usr/include/c++/4.9/ext/new_allocator.h:33, from /usr/include/x86_64-linux-gnu/c++/4.9/bits/c++allocator.h:33, from /usr/include/c++/4.9/bits/allocator.h:46, from /usr/include/c++/4.9/string:41, from /usr/include/boost/program_options/errors.hpp:12, from /usr/include/boost/program_options/options_description.hpp:12, from option_groups.cpp:24: /usr/include/c++/4.9/exception:60:9: note: candidates are: class std::exception class exception ^ In file included from /usr/include/boost/throw_exception.hpp:43:0, from /usr/include/boost/any.hpp:26, from /usr/include/boost/program_options/value_semantic.hpp:12, from /usr/include/boost/program_options/options_description.hpp:13, from option_groups.cpp:24: /usr/include/boost/exception/exception.hpp:208:5: note: class boost::exception exception ^ option_groups.cpp:96:11: error: ‘exception’ does not name a type catch(exception& e) { ^ option_groups.cpp:97:17: error: ‘e’ was not declared in this scope cout << e.what() << "\n"; ^

On 02/15/2015 09:03 PM, U.Mutlu wrote:
I've boost 1.55 from the debian repository. I'm trying to compile the below example of the 1.55 version (it's same as that of 1.57), but I get the following compile errors. Should I use some 'magic' compiler options, or what else is the reason for this grandious failure?
$ g++ -Wall -std=gnu++11 option_groups.cpp -lboost_program_options option_groups.cpp: In function ‘int main(int, char**)’: option_groups.cpp:44:46: error: ‘class boost::program_options::typed_value<std::basic_string<char>, char>’ has no member named ‘implicit’ ("help-module", value<string>()->implicit(), ^ option_groups.cpp:96:11: error: reference to ‘exception’ is ambiguous catch(exception& e) {
Fixed here: https://github.com/boostorg/program_options/commit/0f9793e369d0068fb65f81290... -- Vladimir Prus CodeSourcery / Mentor Embedded http://vladimirprus.com

Vladimir Prus wrote, On 02/15/2015 07:43 PM:
On 02/15/2015 09:03 PM, U.Mutlu wrote:
I've boost 1.55 from the debian repository. I'm trying to compile the below example of the 1.55 version (it's same as that of 1.57), but I get the following compile errors. Should I use some 'magic' compiler options, or what else is the reason for this grandious failure?
$ g++ -Wall -std=gnu++11 option_groups.cpp -lboost_program_options option_groups.cpp: In function ‘int main(int, char**)’: option_groups.cpp:44:46: error: ‘class boost::program_options::typed_value<std::basic_string<char>, char>’ has no member named ‘implicit’ ("help-module", value<string>()->implicit(), ^ option_groups.cpp:96:11: error: reference to ‘exception’ is ambiguous catch(exception& e) {
Fixed here:
https://github.com/boostorg/program_options/commit/0f9793e369d0068fb65f81290...
Ok, thx, now with these changes it compiles successfully. BTW, as said in other posting of mine today, in the online-documentation of this sub-library at boost.org a link to its "example" directory is missing. -- cu Uenal

On 02/16/2015 01:53 AM, U.Mutlu wrote:
Vladimir Prus wrote, On 02/15/2015 07:43 PM:
On 02/15/2015 09:03 PM, U.Mutlu wrote:
I've boost 1.55 from the debian repository. I'm trying to compile the below example of the 1.55 version (it's same as that of 1.57), but I get the following compile errors. Should I use some 'magic' compiler options, or what else is the reason for this grandious failure?
$ g++ -Wall -std=gnu++11 option_groups.cpp -lboost_program_options option_groups.cpp: In function ‘int main(int, char**)’: option_groups.cpp:44:46: error: ‘class boost::program_options::typed_value<std::basic_string<char>, char>’ has no member named ‘implicit’ ("help-module", value<string>()->implicit(), ^ option_groups.cpp:96:11: error: reference to ‘exception’ is ambiguous catch(exception& e) {
Fixed here:
https://github.com/boostorg/program_options/commit/0f9793e369d0068fb65f81290...
Ok, thx, now with these changes it compiles successfully.
BTW, as said in other posting of mine today, in the online-documentation of this sub-library at boost.org a link to its "example" directory is missing.
Could you be more specific as to what page contains a broken link or fails to contain a link? It's a bit hard to produce an absolute link that will work for official release, for Ubuntu package and for website, all at the same time. -- Vladimir Prus CodeSourcery / Mentor Embedded http://vladimirprus.com

Vladimir Prus wrote, On 02/16/2015 05:38 AM:
On 02/16/2015 01:53 AM, U.Mutlu wrote:
Vladimir Prus wrote, On 02/15/2015 07:43 PM:
Fixed here:
https://github.com/boostorg/program_options/commit/0f9793e369d0068fb65f81290...
Ok, thx, now with these changes it compiles successfully.
BTW, as said in other posting of mine today, in the online-documentation of this sub-library at boost.org a link to its "example" directory is missing.
Could you be more specific as to what page contains a broken link or fails to contain a link?
It's a bit hard to produce an absolute link that will work for official release, for Ubuntu package and for website, all at the same time.
I mean the online-documentation at boost.org: On the TOC-page of 'program options' http://www.boost.org/doc/libs/1_57_0/doc/html/program_options.html there should be an item for the examples (maybe describing shortly what each of the example does), and of course a link to the example(s) directory itself: http://www.boost.org/doc/libs/1_57_0/libs/program_options/example/ -- cu Uenal
participants (2)
-
U.Mutlu
-
Vladimir Prus