MPI的mpicc和mpicxx命令编译C++程序时,可能会遇到如下三种错误信息:
#error "SEEK_SET is #defined but must not be for the C++ binding of MPI"
#error "SEEK_CUR is #defined but must not be for the C++ binding of MPI"
#error "SEEK_END is #defined but must not be for the C++ binding of MPI"
原因:
Is the result of a name conflict between stdio.h and the MPI C++ binding.
解决方法
Users should place the mpi include before the stdio.h and iostream includes.
简单的就,就是头文件包含的顺序问题,可能是把#include <iostream>放在了#include "mpi.h"的前面,才出现了如此莫名其妙的错误……
把#include "mpi.h"放在最前面就OK了。