Boost logo

Boost :

Subject: [boost] [mpi] Unresolved external
From: Nils van der Struis (nvdstruis_at_[hidden])
Date: 2011-07-18 08:59:03

Hi all,

I installed the boostpro libraries version 1.46.1. Then I got the openmpi 1.4.3 sources and successfully built them with cmake/VS2008. Now I'm trying to run some example code:
#include <boost/mpi.hpp>
#include <iostream>
#include <string>
#include <boost/serialization/string.hpp>
namespace mpi = boost::mpi;

int main(int argc, char* argv[])
  mpi::environment env(argc, argv);
  mpi::communicator world;

  if (world.rank() == 0) {
    world.send(1, 0, std::string("Hello"));
    std::string msg;
    world.recv(1, 1, msg);
    std::cout << msg << "!" << std::endl;
  } else {
    std::string msg;
    world.recv(0, 0, msg);
    std::cout << msg << ", ";
    world.send(0, 1, std::string("world"));

  return 0;
This keeps giving me the linker error below. My dependencies are libmpi.lib, libmpi_cxx.lib, boost_mpi-vc90-mt-1_46_1.lib, libboost_mpi-vc90-mt-1_46_1.lib. I also tried with the pre built openmpi version 1.5.3 library files, this didn't help.
Error 1 error LNK2019: unresolved external symbol "public: __thiscall boost::mpi::communicator::operator struct ompi_communicator_t *(void)const " (??Bcommunicator_at_mpi@boost@@QBEPAUompi_communicator_t@@XZ) referenced in function "protected: void __thiscall boost::mpi::communicator::send_impl<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct boost::mpl::bool_<0>)const " (??$send_impl_at_V?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@communicator_at_mpi@boost@@IBEXHHABV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@U?$bool_@$0A@@mpl_at_2@@Z) MPITest.obj MPITest
 I suppose this is caused by the libraries?! Could somebody help me out here?Thanks

Boost list run by bdawes at, gregod at, cpdaniel at, john at