Menu

Where is putchar() ?

2001-03-11
2003-01-22
  • Mario Zimmermann

    Hello,

    when using several string functions (i.e. sprintf) the linker complains a missing putchar().

    Indeed it is not in the source files, only external references to putchar().

    Am I missing something here?
    I'm using SDCC 2.2.1 on W2K (cygwin).

    Mario

     
    • Sten D. Iversen

      Sten D. Iversen - 2001-03-12

      Hi Mario.

      No the is no putchar function, you need to define it you're self.
      Perhaps one of the reasons for obmitting the putchar function is to make the system more flexible... e.g you define if putchar uses the internal serial uart or a display device or any other device where you want the string to be displayed...

      Topper :-)

       
      • Mario Zimmermann

        Hi Topper,

        that makes sense. Thanks!

        Mario

         
        • Johan Knol

          Johan Knol - 2001-06-12

          e.g. in sdcc/device/examples/mcs51/clock

           
      • Anonymous

        Anonymous - 2001-06-12

        So is there any examples showing how exactly I can write a putchar() to the UART?

         
    • karthik bala guru

      Do tell me how to use printf ???

      # include<stdio.h>
      # include<8051.h>

      void main(void)
      {
      printf("hallo");
      }

      How to do the above with sdcc ???

       

Log in to post a comment.

MongoDB Logo MongoDB