您的位置:首页 > Web前端

【并行计算】error C2555: 'MPI::Intercomm::Clone' : overriding virtual function differs from 'MPI::C

2014-02-17 10:48 381 查看

【转】error C2555: 'MPI::Intercomm::Clone' : overriding virtual function differs from 'MPI::C

重载错误:

d:\program files\mpich2\include\mpicxx.h(1536) : error C2555: 'MPI::Intercomm::Clone' : overriding virtual function differs from 'MPI::Comm::Clone' only by return type or calling convention

d:\program files\mpich2\include\mpicxx.h(1107) : see declaration of 'Comm'

解决方法:

在细看错误,都是一些函数重载错误,部是mpicxx.h文件导致的错误,于是想是否MPI_Init等函数与此文件有关。通过搜索包含文字,发现MPI_Init等函数只在mpi.h中定义,于是想办法不包含mpicxx.h文件以避开问题。在mpi.h中发现代码:

#if !defined(MPICH_SKIP_MPICXX)

#include "mpicxx.h"

#endif

在程序中定义宏MPICH_SKIP_MPICXX,然后重新编译程序(注意在包含mpi.h前定义)。果然避开了mpicxx.h文件,OK!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: