本文介绍了如何在"ioctl"之前修复"expected'=",“,",“;","asm"或"__attribute__"错误 ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows平台上的Code Composer Studio中实现嵌入式c程序时,遇到了以上错误.

此错误出现在此行的"ioctl.h"文件中:
int __cdecl ioctl(int __fd,int __cmd);

如何解决此错误?

I got above error, while implementing an Embedded c program, in code composer studio, on windows platform.

This error comes in ''ioctl.h'' file at this line :
int __cdecl ioctl (int __fd, int __cmd);

How to fix this error ?

推荐答案

#define __cdecl


但是,可能还会出现其他问题,因此您应该检查是否可以为目标平台设置开发环境.

对于x86 CPU,gcc使用__attribute__指定C调用约定,您可以使用:


However, there may be other issues coming up so you should check if you can setup your development environment for your target platform.

With x86 CPUs, gcc uses __attribute__ to specify the C calling convention and you can use:

#define __cdecl __attribute__((__cdecl__))



如有其他疑问,您应提供有关所用编译器(名称和版本)和目标平台(体系结构和OS)的其他信息.



For further questions you should provide additional information about the used compiler (name and version) and target platform (architecture and OS).


这篇关于如何在"ioctl"之前修复"expected'=",“,",“;","asm"或"__attribute__"错误 ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 19:05