I'm having problems building programs with program_options and vc8/2005.
I'm getting linker errors... any suggestions? I suspect I'm doing
something obvious wrong.
Linking against 1.33.1, I have $(BOOST_ROOT)\bin\boost\libs in
"Additional Library directories". I get "already defined" and
"unresolved" errors when I try to use program_options code that builds
in vc71. For example:
//no problem here...
#include
using namespace std;
using namespace boost;
using namespace boost::program_options;
void func()
{
//but with this I get linker errors
variables_map l_vm;
}
//...such as:
1>libboost_program_options-vc80-mt-gd-1_33_1.lib(variables_map.obj) :
error LNK2005: "class std::basic_ostream & __cdecl std::operator<<(class
std::basic_ostream &,class
std::basic_string const &)"
(??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z)
already defined in msvcprtd.lib(MSVCP80D.dll)
//and:
1>libboost_program_options-vc80-mt-gd-1_33_1.lib(options_description.obj)
: error LNK2019: unresolved external symbol "__declspec(dllimport)
public: class std::reverse_iterator::const_iterator>
__thiscall std::basic_string::rbegin(void)const "
(__imp_?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$reverse_iterator@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ)
referenced in function "public: bool __thiscall
boost::program_options::option_description::match(class
std::basic_string const &,bool)const "
(?match@option_description@program_options@boost@@QBE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
Any suggestions?