I tried to compile a simple test program, but it doesn't link
dynamically. Any suggestions, what I'm doing wrong?
I'm using boost 1.34.1 prebuilt libs from boost-consulting and MSVC 7.1.
The test code which fails:
#include
namespace po = boost::program_options;
int main(int argc, char** argv)
{
unsigned int i1;
po::options_description normal_options("parameters");
normal_options.add_options()
("test,t", po::value<unsigned int>(&i1)->default_value(0), "test")
;
return 0;
}
I compile using the following command:
cl /TP /EHsc /nologo /GR /WL /W2 /Od /MDd /GS /Z7 /DBOOST_ALL_NO_LIB
/Ih:\repos\trunk\3rd\include\common\boost\1_34_1 /c main.cpp /Fomain.obj
The linker command
link /nologo /OUT:test.exe
/LIBPATH:h:\repos\trunk\3rd\lib\win32\cl\13.10\boost\1_34_1
boost_program_options-vc71-mt-gd-1_34_1.lib /DEBUG main.obj
fails with the error message
main.obj : error LNK2001: unresolved external symbol "class
std::basic_string boost::program_options::arg"
(?arg@program_options@boost@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
However, when linking statically using
link /nologo /OUT:test.exe
/LIBPATH:h:\repos\trunk\3rd\lib\win32\cl\13.10\boost\1_34_1
libboost_program_options-vc71-mt-gd-1_34_1.lib /DEBUG main.obj
then everything is working...
Any ideas?
Thank you in advance,
Robert