2009/11/05

Boost ProgramOptions Link Error

Boost Program-Options occurs link error on dynamic linking.

Its reason is here. (See also here and here)

The following is patched.

In file options_description.hpp, line 158: Replaced
static const unsigned m_default_line_length;
with
BOOST_STATIC_CONSTANT (unsigned, m_default_line_length = 80);

This is an old fix that I found in the mail archives (2005), seems to have been erroneously dropped from the base-line.

In file options_description.cpp: removed the declaration of m_default_line_length.

arg() is not fixed now, since I can use static version of Program-Options.

No comments:

How to set parameters to debugging program on Visual Studio 2019 with CMake

Solution: MSDN Sometimes the "Debug and Launch Settings for CMake" bottun is disabled. In this case, change to the target view. ...