Keil compilation error
#include <stdio.h>
#include <stdlib.h>
...
#define Result_TIMOUT 3
#define Result_INTIAL 0
#define Result_ERROR 1
...
typedef enum
{
MD_INIT,
HARDWARE_CHECK,
FILESYSTEM,
BS_SEARCH,
BS_REGISTER,
BS_REG_CHK,
ME_FC_INIT,
ME_SOCKET,
ME_READY
}STATUS_MACHINE_INDEX;
... // struct, enum, union
extern md_Socket_CB SocketOpen_CB;
extern md_Socket_CB SocketClose_CB;
...
Solution:
Use conditional compilation to prevent header files from being included repeatedly. Take the above code as an example
#ifndef __MODEM_H__
#define __MODEM_H__
#include <stdio.h>
#include <stdlib.h>
...
#define Result_TIMOUT 3
#define Result_INTIAL 0
#define Result_ERROR 1
...
typedef enum
{
MD_INIT,
HARDWARE_CHECK,
FILESYSTEM,
BS_SEARCH,
BS_REGISTER,
BS_REG_CHK,
ME_FC_INIT,
ME_SOCKET,
ME_READY
}STATUS_MACHINE_INDEX;
... // struct, enum, union
extern md_Socket_CB SocketOpen_CB;
extern md_Socket_CB SocketClose_CB;
...
#endif
Keil compiled successfully
Read More:
- [Solved] MIT cheetah make error: ‘ioctl’ was not declared in this scope
- How to Solve Error:‘itoa’ was not declared in this scope
- [Solved] error: ‘CV_GRAY2BGR’ was not declared in this scope
- [Solved] error: ‘xcb_generic_event_t’ was not declared in this scope
- [Solved] KEIL Error: keil Error: failed to execute ‘C:\Keil\ARM\ARMCC‘
- error: field ‘XXX’ declared as a function [How to Solve]
- [Solved] RuntimeError: An attempt has been made to start a new process before the current process…
- [Solved] Keil Error: *** ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED
- [Solved] OpenCV ERROR: The minSdk version should not be declared in the android manifest file
- How to Solve UW Microcontroller KEIL _WEAK Error
- How to Solve Keil Error: error: #29: expected an expression
- keil: ERROR L107:ADDRESS SPACE OVERFlOW [How to Solve]
- keil error #1-D: last line of file ends without a newline
- Keil5 error: #29: expected an expression [Solved]
- Keil’s duplicate definition problem: Error: L6200E: Symbol F6x8 multiply defined
- (Keil MDK) UCOS floating point support abnormal solution
- [Solved] Keil5 burn STM32F chip Error: error: Flash download failed – “cortex-m4″“
- [Solved] keil2 Error: FATAL ERROR L210: I/O ERROR ON INPUT FILE
- [Solved] PCH Warning: header stop not at file scope
- [Solved] KEIL Compile Error: Error: L6220E: Load region LR_IROM1 size (65552 bytes) exceeds limit (65536 bytes)……