Opened 7 years ago
Last modified 6 years ago
#11905 new Bugs
Exception "character conversion failed" when omitting argument
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost 1.60.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hello,
The minimal example I attached simply assigns the value of the optional parameter -i to an int. When the parameter is given (./a.out -i 42), the program exits normally. But if I omit the parameter (./a.out), then the exception "character conversion failed" is raised. It doesn't matter whether the option is "required" or not, or whether a default value is given.
Configuration for which I found the bug: CentOS: 7.2 gcc: 4.8.5 boost: both 1.60.0 and 1.54.0
Configuration for which the bug does not occur: Linux Mint 17.2 gcc 4.8.4 boost 1.54.0
Regards, Thibaut Lepage
Attachments (1)
Change History (2)
by , 7 years ago
Attachment: | minimal_example.cpp added |
---|
comment:1 by , 6 years ago
At least on my system, this had to do with the linker searching for Boost libraries with another version (1.58), while I was compiling against 1.60. This was on Ubuntu 16.04 LTS. Fixing the linker paths got rid of the error.
Minimal example