GCC错误:应为‘;)’;之前<;功能协议计数器>;参数
在头文件中GCC错误:应为‘;)’;之前<;功能协议计数器>;参数,c,gcc,C,Gcc,在头文件中 外部无效跟踪通信(通信块mdbMessage) 在“mdbMessage”之前给出error:expected'), 我确信communicationBlock\u t在范围内(并且相信传递指针会更有效) 如果我将communicationBlock\t的声明复制到extern违规行之前,则错误为 error: conflicting types for ‘communicationBlock_t’ note: previous declaration of ‘communica
外部无效跟踪通信(通信块mdbMessage)代码>
在“mdbMessage”之前给出error:expected'),
我确信communicationBlock\u t
在范围内(并且相信传递指针会更有效)
如果我将communicationBlock\t
的声明复制到extern
违规行之前,则错误为
error: conflicting types for ‘communicationBlock_t’
note: previous declaration of ‘communicationBlock_t’ was here
这似乎意味着违规行可以访问communicationBlock\t
我想我忽略了一些琐碎和明显的事情,但我已经编码了一整晚,不能再直接思考了
我做错了什么?谢谢,一百万
更新:我猜这是一个包含文件的混乱
typedef struct
{
communicationMessage_t message;
uint8_t length;
#ifdef TESTING
char commandName[32]; // for testing porpoises
DoRunTimeChecks runTimeCheckCallback;
#endif
} communicationBlock_t;
在我看来,您正在使用变量作为类型名。通信阻塞的声明是什么样子的?对不起,各位。正如我所怀疑的那样,《包含文件》(include files)中有一个致命的拥抱,那就是确保Trace\u通信
和mdbMessage
不在\define
d或typedef
d任何地方。+1它们不在这里,但感谢您的提示“以前的‘通信阻塞’声明在这里”指向正确的地方,这是你期望的声明吗?如果在Trace\u Communication()
的原型中将communicationBlock\u t
替换为int
,会发生什么情况?