Boost C++ Libraries: Ticket #2506: program_options::arg undefined. Win DLL https://svn.boost.org/trac10/ticket/2506 <p> In Boost 1.37.0, program_options::arg appears to be undefined in the program_options DLL built for windows. Declared as extern in the boost code, but never defined so ends up being an unresolved at link time. </p> <p> Must add the following line in my program to work around: BOOST_PROGRAM_OPTIONS_DECL std::string boost::program_options::arg; </p> <p> FYI, had to define BOOST_ALL_NO_LIB macro to dodge unrelated boost bug (but maybe that cause this?). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2506 Trac 1.4.3 Vladimir Prus Mon, 17 Nov 2008 20:30:19 GMT <link>https://svn.boost.org/trac10/ticket/2506#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2506#comment:1</guid> <description> <p> It is definitely defined, in libs/program_options/value_semantic.cpp: </p> <pre class="wiki">BOOST_PROGRAM_OPTIONS_DECL std::string arg("arg"); </pre><p> Are you sure you are linking to the right version of the library? E.g. if you're linking to program_options dynamically, then you should define BOOST_PROGRAM_OPTIONS_DYN_LINK when building your own code. </p> </description> <category>Ticket</category> </item> <item> <author>patbob@…</author> <pubDate>Mon, 17 Nov 2008 21:50:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2506#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2506#comment:2</guid> <description> <p> No, I did not define that undocumented symbol. Defining it fixed things. </p> <p> That define appears to be undocumented -- that string appears nowhere in any of the html doc files bundled with 1.37.0, and I never saw it while perusing the program options doc files. So, naturally, I didn't know I needed to define it :) </p> <p> Also fixed defect 1904 (undefined reference to `boost::program_options::options_description::m_default_line_length'), which I was also having problems with. </p> <p> Go ahead and close this bug -- it's a non-problem once you know about that define. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Sat, 30 May 2009 10:21:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2506#comment:3 https://svn.boost.org/trac10/ticket/2506#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket