2012-04-26 103 views
1

在一个标题文件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; 
+1

请确保'Trace_Communication'和'mdbMessage'不是'#define'd或'typedef'd任何地方。 – 2012-04-26 00:44:45

+0

+1他们不是,但感谢提示 – Mawg 2012-04-26 01:04:49

+1

“以前的声明'communicationBlock_t'在这里”是指向正确的地方,是你期望的声明吗?如果在'Trace_Communication()'的原型中用'int'替换'communicationBlock_t',会发生什么? – 2012-04-26 01:12:17

回答

0

对不起,伙计们。这是,因为我怀疑#include文件中有一个拥抱#

1

就像你使用一个变量作为类型名称在我看来。 communicationBlock_t的声明是什么样的?

+0

+1查看更新的问题 – Mawg 2012-04-26 01:05:00

相关问题