c8051sdcc

MCU 8051 IDE 'Small Device C Compiler' (SDCC) compiler with C language is not compiling


I have a problem with an MCU 8051 IDE simulator. When using the C language it was outputting the message "no sdcc compiler". After I installed the SDCC compiler on my PC, this part worked.

But after I wrote a C program and compiled it, this message came:

sdcc -mmcs51 --iram-size 256 --xram-size 0 --code-size 8192  --nooverlay --compile-only --noinduction --std-sdcc89 --model-small   "task1.1cpro.c"

Output:

task1.1cpro.c:6: warning 94: comparison is always true due to limited range of data type

Unable to find "task1.cdb"
  |
  +-- Most probably that indicates that you have disabled debugging switch, if it is not that what you want then go to
      [Main Menu] --> [Configure] --> [Compiler configuration] --> [C language] --> [General] and enable "--debug" compiler switch. "

What is the matter? I can't find it. How can I solve this problem?


Solution

  • After installing SDCC, you can type this in the Windows prompt to check its version:

    sdcc -v .
    

    Now create a folder called src to store your C files. Write your code and save as file code.c in the src folder.

    Then open cmd.exe and navigate to the src folder. Type the following command to compile the C file.

    sdcc code.c
    

    If there aren't any errors, the code will compile and generate several files.