在一个标题文件GCC错误:<函数protoyprmeter>之前预期 ')' 参数
extern void Trace_Communication(communicationBlock_t mdbMessage);
给出error: expected ‘)’ before ‘mdbMessage’
我确信communicationBlock_t
是在范围(和reliaze,这将是更有效地传递指针)
如果我复制communicationBlock_t
的声明之前extern
违规行,错误是
error: conflicting types for ‘communicationBlock_t’
note: previous declaration of ‘communicationBlock_t’ was here
这似乎意味着该问题的行访问的communicationBlock_t
声明我猜,我俯瞰一些小事和明显的,但我一直在编码了一夜,再也不能把直...
我在做什么错?感谢1,000,000
更新:我的猜测是,它是一个包含文件纠结......
typedef struct
{
communicationMessage_t message;
uint8_t length;
#ifdef TESTING
char commandName[32]; // for testing porpoises
DoRunTimeChecks runTimeCheckCallback;
#endif
} communicationBlock_t;
请确保'Trace_Communication'和'mdbMessage'不是'#define'd或'typedef'd任何地方。 – 2012-04-26 00:44:45
+1他们不是,但感谢提示 – Mawg 2012-04-26 01:04:49
“以前的声明'communicationBlock_t'在这里”是指向正确的地方,是你期望的声明吗?如果在'Trace_Communication()'的原型中用'int'替换'communicationBlock_t',会发生什么? – 2012-04-26 01:12:17