Boost logo

Boost Users :

Subject: [Boost-users] boost linker errors
From: Mark (markusb51_at_[hidden])
Date: 2016-03-20 14:03:25


Hi

I am trying to link to a boost library, program_options, using Visual Studio 2015 and I am getting 'lnk2019 unresolved external symbol’ errors.

I have built the boost libraries using b2 and built the complete libraries for msvc. The libraries are 32 bit. I have configured visual studio to point at the correct location for both the headers and the libraries, I’ve confirmed this. I am statically linking against libboost_program_options-vc140-mt-sgd-1_60.lib, though I have tried all the other variants of this library, e.g. removed the mt, the gd and the s parts of the name, without effect. I have tried all the different calling convention options in properties, I am building with the /MTd option set, though I have tried others. i have searched the internet thoroughly and cannot find a replication of my problem. Using BOOST_LIB_DIAGNOSTIC confirms that the library is being linked, I see the message in the output window. The errors I am getting are:

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "void __cdecl simulate(class nemo::Simulation *,unsigned int,unsigned int,class std::basic_ostream<char,struct std::char_traits<char> > &)" (?simulate@@YAXPAVSimulation_at_nemo@@IIAAV?$basic_ostream_at_DU?$char_traits_at_D@std@@@std@@@Z) referenced in function _main NeMo_Test C:\Users\Development\Documents\Visual Studio 2015\Projects\NeMo_Test\NeMo_Test\main.obj 1
Error LNK2019 unresolved external symbol "long __cdecl benchmark(class nemo::Simulation *,unsigned int,unsigned int,class boost::program_options::variables_map &,unsigned int)" (?benchmark@@YAJPAVSimulation_at_nemo@@IIAAVvariables_map_at_program_options_at_boost@@I_at_Z) referenced in function _main NeMo_Test C:\Users\Development\Documents\Visual Studio 2015\Projects\NeMo_Test\NeMo_Test\main.obj 1
Error LNK2019 unresolved external symbol "class nemo::Configuration __cdecl configuration(class boost::program_options::variables_map &)" (?configuration@@YA?AVConfiguration_at_nemo@@AAVvariables_map_at_program_options_at_boost@@@Z) referenced in function _main NeMo_Test C:\Users\Development\Documents\Visual Studio 2015\Projects\NeMo_Test\NeMo_Test\main.obj 1
Error LNK2019 unresolved external symbol "class boost::program_options::variables_map __cdecl processOptions(int,char * * const,class boost::program_options::options_description const &)" (?processOptions@@YA?AVvariables_map_at_program_options_at_boost@@HQAPADABVoptions_description_at_23@@Z) referenced in function _main NeMo_Test C:\Users\Development\Documents\Visual Studio 2015\Projects\NeMo_Test\NeMo_Test\main.obj 1
Error LNK2019 unresolved external symbol "class boost::program_options::options_description __cdecl commonOptions(void)" (?commonOptions@@YA?AVoptions_description_at_program_options_at_boost@@XZ) referenced in function _main NeMo_Test C:\Users\Development\Documents\Visual Studio 2015\Projects\NeMo_Test\NeMo_Test\main.obj 1
Error LNK1120 5 unresolved externals NeMo_Test C:\Users\Development\Documents\Visual Studio 2015\Projects\NeMo_Test\Debug\NeMo_Test.exe 1

I would be very grateful if anyone could provide a clue as to what I am missing or have done wrong.

Many thanks



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