I am working on lpcxpresso (lpc1768)
. I have included a .h
file and two .c
files in my already written code (these files have been created using flex
and bison
). I want to use the option "Newlib(semihost)" under "quick settings". When i build my code it shows some errors:
我的工作是lpcxpresso (lpc1768)。我已经在我已经编写的代码中包含了一个.h文件和两个.c文件(这些文件是使用flex和bison创建的)。我想在“快速设置”下使用“Newlib(半主机)”选项。当我构建代码时,它会显示一些错误:
"c:\nxp\lpcxpresso_6.1.2_177\lpcxpresso\tools\bin../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/include/newlib_inc/stdint.h:79:21: error: conflicting types for 'int32_t'"
“c:\ nxp \ lpcxpresso_6.1.2_177 \ lpcxpresso \工具\ bin . . / lib / gcc / arm-none-eabi / 4.6.2 / . . / . . / . . / . . / arm-none-eabi / include / newlib_inc / stdint。h:79:21:错误:“int32_t”的冲突类型
"c:\nxp\lpcxpresso_6.1.2_177\lpcxpresso\tools\bin../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/include/newlib_inc/stdint.h:80:23: error: conflicting types for 'uint32_t'"
“c:\ nxp \ lpcxpresso_6.1.2_177 \ lpcxpresso \工具\ bin . . / lib / gcc / arm-none-eabi / 4.6.2 / . . / . . / . . / . . / arm-none-eabi / include / newlib_inc / stdint。h:80:23:错误:“uint32_t”的冲突类型
When I switch to library Redlib then these errors do not occur but some other problems arise. I want to use Newlib.
当我切换到library Redlib时,这些错误不会发生,但是会出现一些其他问题。我想使用Newlib。
Why these errors are occurring ? What do I need to do?
为什么会出现这些错误?我需要做什么?
1 个解决方案
#1
1
This error arises due to multiple deffinitions of int32_t and uint32_t in different header files. Check the build log to find any information related to where this multiple definition/declaration happened. See if you can use the system header file for these type definitions, and in case there is additional code in your header, use conditional macros to disable typedef part. Hope this helps.
由于在不同的头文件中有多个int32_t和uint32_t的错误,出现了这个错误。检查构建日志,以查找与该多个定义/声明发生的位置相关的任何信息。查看是否可以为这些类型定义使用系统头文件,如果您的头中有额外的代码,请使用条件宏来禁用typedef部分。希望这个有帮助。
#1
1
This error arises due to multiple deffinitions of int32_t and uint32_t in different header files. Check the build log to find any information related to where this multiple definition/declaration happened. See if you can use the system header file for these type definitions, and in case there is additional code in your header, use conditional macros to disable typedef part. Hope this helps.
由于在不同的头文件中有多个int32_t和uint32_t的错误,出现了这个错误。检查构建日志,以查找与该多个定义/声明发生的位置相关的任何信息。查看是否可以为这些类型定义使用系统头文件,如果您的头中有额外的代码,请使用条件宏来禁用typedef部分。希望这个有帮助。