somefile.h返回類型默認爲 'INT' 在C代碼
內容#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上,我得到以下錯誤:
error: return type defaults to 'int'
我該如何解決這個問題?
不要使用'__SOMEFILE_H',這些名字被保留用於執行。 – 2012-07-10 15:52:40
@丹尼爾,它實際上是一個不同的名字,我只是爲了簡單而在這裏發佈。 – RRR 2012-07-10 15:54:58
請發佈您的實際頭文件,但這並不反映您的問題 – ouah 2012-07-10 15:58:02