CodeBlocks + SDCC open source compiler C51 microcontroller compilation settings
SDCC-small device C compiler download URL:
http://sdcc.sourceforge.netRecommended installation directory C:\sdcc
CodeBlocks compiler settings, select SDCC Compiler
The compiler directory is filled with C:\sdcc
Search directory-compiler header file C:\sdcc\include
Search directory-compiler library file C:\sdcc\lib
# Set directory
C:\sdcc
C:\sdcc\include
C:\sdcc\lib
# CodeBlocks Create a new project, choose MCS51 Project, and choose SDCC Compiler by default, the template will automatically add the command to convert C51 to HEX file
cmd /c "packihx <$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).ihx >$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).hex"