0

somefile.h 的内容

#ifndef __SOMEFILE_H
#define __SOMEFILE_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _table_t table_t;

struct _table_t
{
     void (*somefunction1)();
     void (*somefunction2)(int a);
     void (*somefunction3)(int a, int *b);
};

#ifdef __cplusplus
} 
#endif
#endif <-- I am getting the error here

somefile.h 包含在 .cpp 和 .c 文件中。当这个项目在 Linux 上构建时,我收到以下错误:

错误:返回类型默认为“int”

我怎样才能解决这个问题?

4

1 回答 1

3

您有一个未定义返回类型的函数。寻找类似的东西

Foo(void);

或者

Foo(void) {
  printf("foo you too");
}
于 2012-07-10T16:07:29.427 回答