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 &)" (?simulate@@YAXPAVSimulation@nemo@@IIAAV?$basic_ostream@DU?$char_traits@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@nemo@@IIAAVvariables_map@program_options@boost@@I@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@nemo@@AAVvariables_map@program_options@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@program_options@boost@@HQAPADABVoptions_description@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@program_options@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