您的位置:首页 > 编程语言 > C语言/C++

MPI编译C++程序出现#error "SEEK_SET is #defined but must not be for the C++ binding of MPI" 的解决方法

2010-11-09 13:18 1596 查看
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了。





参考:http://www.nics.tennessee.edu/node/295
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐