我想写一个包装MPI的框架库。结构在头编译错误
我有一个框架调用afw.h
的头文件和一个名为afw.c
的框架的实现文件。
我希望能够通过在应用程序代码中执行#include "afw.h"
来编写使用框架的应用程序代码。
从afw.h
的摘录:
#ifndef AFW_H
#define AFW_H
#include <mpi.h>
struct ReqStruct
{
MPI_Request req;
};
ReqStruct RecvAsynch(float *recvbuf, FILE *fp);
int RecvTest(ReqStruct areq);
我在afw.c
(在这种情况下的MPI编译包装器使用PGC的下面)提供了RecvAsynch
一个实现其#includes afw.h
当我编译使用mpicc
:
mpicc -c afw.c -o afw.o
我得到:
PGC-S-0040-Illegal use of symbol, ReqStruct (./afw.h: 69)
PGC-W-0156-Type not specified, 'int' assumed (./afw.h: 69)
PGC-S-0040-Illegal use of symbol, ReqStruct (./afw.h: 71)
PGC-W-0156-Type not specified, 'int' assumed (./afw.h: 71)
和类似的错误,无论ReqStruct
在afw.c
任何想法,我做错了使用?
+1打我一毫秒 – Anonymous 2012-04-04 14:40:01
是的,当然,谢谢你。我以为在写作之前我已经打了折扣,但显然不是! – 2012-04-04 14:46:53