title: MPI complile error, undefined reference to `MPI::Win::Free()
body: <p>I trying to compile a code written mostly in Fortran with some parts in C, the use some libraries such HDF5 and MPI and probably is written using openmpi 3.2.1 but i have openmpi 4.0.3 installed on ubuntu 20.04. I now that the code work with MPICH.</p>
  
  <p>when I compile I got errors like:</p>
  
  <pre><code>h5pfc -g -lstdc++ -pthread -L/usr/local/include/cantera -lcantera    -L/usr/local/include/cantera -lcantera_fortran -lcantera    -lpthread -lstdc++ ../bin/*.o -o ../bin/amr3d  
  /usr/bin/ld: ../bin/distance_to_wall.o: in function `MPI::Intracomm::Intracomm()':
  /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
  /usr/bin/ld: ../bin/distance_to_wall.o: in function `MPI::Intracomm::Intracomm(ompi_communicator_t*)':
  /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined reference to `MPI::Comm::Comm()'
  /usr/bin/ld: ../bin/distance_to_wall.o: in function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&amp;), bool)':
  /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/op_inln.h:121: undefined reference to `ompi_mpi_cxx_op_intercept'
  /usr/bin/ld: ../bin/distance_to_wall.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
  /usr/bin/ld: ../bin/distance_to_wall.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
  collect2: error: ld returned 1 exit status
  make: *** [Makefile:326: amr3d] Error 1
  </code></pre>
  
  <p>Wath could I do to compile this code?</p>