Opened 14 years ago
Closed 13 years ago
#2506 closed Bugs (fixed)
program_options::arg undefined. Win DLL
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | Boost 1.38.0 | Component: | program_options |
Version: | Boost 1.36.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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.
Must add the following line in my program to work around: BOOST_PROGRAM_OPTIONS_DECL std::string boost::program_options::arg;
FYI, had to define BOOST_ALL_NO_LIB macro to dodge unrelated boost bug (but maybe that cause this?).
Change History (3)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
No, I did not define that undocumented symbol. Defining it fixed things.
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 :)
Also fixed defect 1904 (undefined reference to `boost::program_options::options_description::m_default_line_length'), which I was also having problems with.
Go ahead and close this bug -- it's a non-problem once you know about that define.
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
It is definitely defined, in libs/program_options/value_semantic.cpp:
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.