Opened 7 years ago

Last modified 6 years ago

#11905 new Bugs

Exception "character conversion failed" when omitting argument

Reported by: Thibaut Lepage <dourak@…> 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)

minimal_example.cpp (359 bytes ) - added by Thibaut Lepage <dourak@…> 7 years ago.
Minimal example

Download all attachments as: .zip

Change History (2)

by Thibaut Lepage <dourak@…>, 7 years ago

Attachment: minimal_example.cpp added

Minimal example

comment:1 by Kristian <klukander@…>, 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.

Note: See TracTickets for help on using tickets.