arm-xilinx-linux-gnueabi-gcc 出现error: 'for' loop initial declarations are only allowed in C99 mode test.c:53:3: note: use option -std=c99 or -std=gnu99 to compile your code
时间: 2024-03-09 14:46:13 浏览: 59
这个错误提示和上面的类似,是因为在 C89/90 标准中,循环中的变量声明必须在函数或作用域的开头,而不能在循环中间进行声明。
同样地,你需要在编译时添加 `-std=c99` 或 `-std=gnu99` 选项来启用 C99 标准。示例命令如下:
```
arm-xilinx-linux-gnueabi-gcc -std=c99 test.c -o test
```
如果你需要在多个文件中使用 C99 标准,你可以将 `-std=c99` 或 `-std=gnu99` 选项加入到你的 Makefile 中,例如:
```
CFLAGS += -std=c99
```
希望对你有所帮助!
相关问题
arm-xilinx-linux-gnueabi-gcc: error: unrecognized command line option ‘-mrecord-mcount’; did you mean ‘-frecord-marker=4’?
This error message indicates that the compiler you are using (arm-xilinx-linux-gnueabi-gcc) does not recognize the command line option "-mrecord-mcount". It suggests that you may have meant to use "-frecord-marker=4" instead.
The "-mrecord-mcount" option is used to generate code that records function call counts, which can be used for profiling and optimization. However, this option may not be supported by all compilers or platforms.
If you need to use function call counting in your code, you may want to investigate alternative approaches that are supported by your compiler and platform. If you are not using function call counting, you can simply remove the "-mrecord-mcount" option from your build command.
arm-none-linux-gnueabi-gcc–v: command not found
这个错误提示意味着系统无法找到名为"arm-none-linux-gnueabi-gcc"的命令或程序。这通常是由于没有正确安装ARM交叉编译工具链或者路径设置不正确导致的。
ARM交叉编译工具链是一种用于在主机上编译ARM架构目标程序的工具集合。如果你想在x86主机上编译ARM架构的程序,就需要使用ARM交叉编译工具链。
如果你已经安装了ARM交叉编译工具链,但仍然出现该错误,可能是由于系统环境变量没有正确设置。你可以检查环境变量中是否包含了ARM交叉编译工具链的路径,或者手动设置环境变量。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)