Home > other >  Keil MDK5 compilation of common problems, mainly is the problem of stm32 writing.
Keil MDK5 compilation of common problems, mainly is the problem of stm32 writing.

Time:09-29


Error: # when. Error: # 18: expected a ") "
More often than not, if it is appeared in the c file because one less "), "line or errors have a compiler could other characters
If appear in the header file, error is a function declaration, for the most part because the compiler doesn't know in function declarations of characters

Error: error # 20: # 20: identifier "TIM2_IRQChannel is undefined" who can say, where is the wrong
Your firmware library files in the database is not added to the project, so the undefined case,
TIM2_IRQChannel refers to the timer interrupt channel 2 is not defined, is in the firmware library for these parameters are defined, macro definition instead of a string of register address data, you need to. C files added to the project file

Warning: # 1 - D main. C (7) : warning: # 1 - D: the last line of the file ends with a newline
When using keil compiler, pop-up warning: main. C (7) : warning: # 1 - D: the last line of the file ends with a newline
This is because the main function of the "} ", without return,
As long as the main function of the "} "after the enter key, the warning message can be removed,

Error: # 65... Test_menu. C (27) : error: # 65: expected a ";"
Your firmware library files in the database is not added to the project, so the undefined case,
TIM2_IRQChannel refers to the timer interrupt channel 2 is not defined, is in the firmware library for these parameters are defined, macro definition instead of a string of register address data, you need to. C files added to the project file

Error: L6200E Error: L6200E: Symbol temp multiply defined (by wenshidu. O and main. O). When compiling to the problem, but hope masters to help you check out
What variables you pay twice value
You see if the external variables you give assignment again
The main c statement, other. Corresponding c file. H file using extern reference

Warning: # 223 - D.. \.. \ source \ CCxx00_New C (718) : warning: # 223 - D: the function "_NOP_" declared implicitly
In the use of the file add extern void _NOP_ (); As well as

Warning: # 1295 - D.. \.. \ include \ CCxx00_New h (20) : warning: # 1295 - D: Deprecated declaration CC_XCal - difference arg types

Error: L6218E: Undefined symbol. \ Obj \ output axf: Error: L6218E: Undefined symbol FSMC_NORSRAMCmd (referred from tft_lcd. O).
. \ Obj \ output. Axf: Error: L6218E: Undefined symbol FSMC_NORSRAMInit (referred from tft_lcd. O).
Target not created

Your firmware library files in the database is not added to the project, so the undefined case,
TIM2_IRQChannel refers to the timer interrupt channel 2 is not defined, is in the firmware library for these parameters are defined, macro definition instead of a string of register address data, you need to. C files added to the project file

Error: # 101: error: # 101: has already had been declared in the current scope

The
# # ifndef __STM32F10x_LIB_H
# define __STM32F10x_LIB_H
# endif adjustment at the end of the day!


Error: # 247: the function "DelayUs" has already had been defined a namesake DelayUs classes have been defined

Error: # 109: expression must have (pointer - to -) function type, the problem is that most of the 19 error, meaning expression requires a (pointer) function parameters, I originally thought it was his mistake, function declarations or call under but saw that there is nothing wrong, it was discovered later checked for a long time made a very low-level mistakes: the macro definition and function of the nuptial, because my first thought is a macro definition corresponds to a function name, so it's more clear, but I was very silly force to the function of each copy directly to the macro name, lead to the result of this kind of broken,

Warning: # 61 - Dwarning: # 68 - D: in KeilARM LPCARM (1 & lt; <31) compilation warning problem
The main c (174) : warning: # 61 - D: integer operation result is out of range
The main c (174) : warning: # 68 - D: integer conversion resulted in a change of sign
Because the compiler default signed int the 32-bit signed integer type, and 1 & lt; <31 actual 0 x80000000,
So it is possible to rewrite the sign bit (highest)
And so on, (2 & lt; <30), (3 & lt; <29)... Will be the compiler warnings such as problems.
Solution: ((unsigned int) 1 & lt; <31), ((unsigned int) 2 & lt; <30),...
  • Related