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

【转】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!

转载于:https://www.cnblogs.com/luffya/p/3552261.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值