Boost logo

Boost Users :

From: Andrew Schweitzer (a.schweitzer.grps_at_[hidden])
Date: 2007-02-18 19:30:01


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 <boost/program_options.hpp>
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<char,struct
std::char_traits<char> > & __cdecl std::operator<<<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::basic_ostream<char,struct std::char_traits<char> > &,class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??$?6DU?$char_traits_at_D@std@@V?$allocator_at_D@1@@std@@YAAAV?$basic_ostream_at_DU?$char_traits_at_D@std@@@0_at_AAV10@ABV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_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<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::const_iterator>
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::rbegin(void)const "
(__imp_?rbegin@?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QBE?AV?$reverse_iterator_at_Vconst_iterator@?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@2_at_XZ)
referenced in function "public: bool __thiscall
boost::program_options::option_description::match(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,bool)const "
(?match_at_option_description_at_program_options_at_boost@@QBE_NABV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@_N_at_Z)

Any suggestions?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net