MPI编译链接器错误

时间:2016-03-18 22:48:19

标签: c++ mpi

我正在尝试编译我的mpi.cpp文件

MPICC -c -O3 mpi.cpp
MPICC -o mpi  -stdlib=libc++  mpi.o common.o

但是我收到以下错误。任何建议将不胜感激,谢谢!我和约塞米蒂一起在MAC上运行。

Undefined symbols for architecture x86_64:
  "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
      std::__1::enable_if<(__is_forward_iterator<std::__1::__wrap_iter<particle_t*> >::value) && (is_constructible<particle_t, std::__1::iterator_traits<std::__1::__wrap_iter<particle_t*> >::reference>::value), std::__1::__wrap_iter<particle_t*> >::type std::__1::vector<particle_t, std::__1::allocator<particle_t> >::insert<std::__1::__wrap_iter<particle_t*> >(std::__1::__wrap_iter<particle_t const*>, std::__1::__wrap_iter<particle_t*>, std::__1::__wrap_iter<particle_t*>) in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__append(unsigned long) in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__swap_out_circular_buffer(std::__1::__split_buffer<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > >&>&) in mpi.o
      void std::__1::vector<particle_t, std::__1::allocator<particle_t> >::__push_back_slow_path<particle_t const>(particle_t const&) in mpi.o
      std::__1::vector<particle_t, std::__1::allocator<particle_t> >::__append(unsigned long) in mpi.o
  "operator delete[](void*)", referenced from:
      _main in mpi.o
  "operator delete(void*)", referenced from:
      _main in mpi.o
      std::__1::enable_if<(__is_forward_iterator<std::__1::__wrap_iter<particle_t*> >::value) && (is_constructible<particle_t, std::__1::iterator_traits<std::__1::__wrap_iter<particle_t*> >::reference>::value), std::__1::__wrap_iter<particle_t*> >::type std::__1::vector<particle_t, std::__1::allocator<particle_t> >::insert<std::__1::__wrap_iter<particle_t*> >(std::__1::__wrap_iter<particle_t const*>, std::__1::__wrap_iter<particle_t*>, std::__1::__wrap_iter<particle_t*>) in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__append(unsigned long) in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__swap_out_circular_buffer(std::__1::__split_buffer<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > >&>&) in mpi.o
      void std::__1::vector<particle_t, std::__1::allocator<particle_t> >::__push_back_slow_path<particle_t const>(particle_t const&) in mpi.o
      std::__1::vector<particle_t, std::__1::allocator<particle_t> >::__append(unsigned long) in mpi.o
  "operator new[](unsigned long)", referenced from:
      _main in mpi.o
  "operator new(unsigned long)", referenced from:
      std::__1::enable_if<(__is_forward_iterator<std::__1::__wrap_iter<particle_t*> >::value) && (is_constructible<particle_t, std::__1::iterator_traits<std::__1::__wrap_iter<particle_t*> >::reference>::value), std::__1::__wrap_iter<particle_t*> >::type std::__1::vector<particle_t, std::__1::allocator<particle_t> >::insert<std::__1::__wrap_iter<particle_t*> >(std::__1::__wrap_iter<particle_t const*>, std::__1::__wrap_iter<particle_t*>, std::__1::__wrap_iter<particle_t*>) in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__append(unsigned long) in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__swap_out_circular_buffer(std::__1::__split_buffer<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > >&>&) in mpi.o
      void std::__1::vector<particle_t, std::__1::allocator<particle_t> >::__push_back_slow_path<particle_t const>(particle_t const&) in mpi.o
      std::__1::vector<particle_t, std::__1::allocator<particle_t> >::__append(unsigned long) in mpi.o
  "___gxx_personality_v0", referenced from:
      _main in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__append(unsigned long) in mpi.o
      std::__1::vector<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > > >::__swap_out_circular_buffer(std::__1::__split_buffer<std::__1::vector<particle_t, std::__1::allocator<particle_t> >, std::__1::allocator<std::__1::vector<particle_t, std::__1::allocator<particle_t> > >&>&) in mpi.o
      Dwarf Exception Unwind Info (__eh_frame) in mpi.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mpi] Error 1

0 个答案:

没有答案