Menu

U8 U32

2007-01-17
2012-09-26
  • Nobody/Anonymous

    What does this mean? and why won't it compile? I believe it must be defined somewhere. But in the header files that a program includes, it doesn't explicitly define it. Does that mean that there is some other secret header file that I need to include that I don't know about? It just uses variables like U8,U32,sfr,sbit, etc. and it won't recognize them, and does U8 always have to be a char? Oh, I am so confused! Please help!

     
    • Nobody/Anonymous

      Wasn't a criticism Clifford.
      Rather a gentle dig at myself for a bit of wooly thinking.

      Wooly thinking = Fuzzy logic, but more so :)

      I often find myself with a wry smile as you or Dr. Wayne patiently
      explain it to to people and think "At least I understand all that"
      Obviously not. At least not to the point of being clear in print.

      For the record then: Mostly I do embedded programming (lighting control systems)
      using either Echelon, MCS51 or PIC µcontrollers. I might well model a new algorithm
      using Dev-C++ / MinGW and have often found myself wishing for a common toolchain across all the platforms I use.

      And now we've probably done this one to death :)

      Del

       
    • Wayne Keen

      Wayne Keen - 2007-01-17

      http://sourceforge.net/forum/forum.php?thread_id=1473510&forum_id=48211

      See the section on the "Basic 3" - it really helps avoid the
      rambling narrative, "what is this and why won't it work" questions

      Wayne

       
      • Wayne Keen

        Wayne Keen - 2007-01-17

        It looks by the way like you might be compiling some Linux
        related code, but I am reluctant to guess too much, hence
        my request for your "Basic 3"

        A slow, careful presentation of

        What you are trying to do, what are your objectives (the big picture)

        What you are trying to do it with (what it is, where you got it, why you figure it will work with Dev-C++)

        What you are doing and seeing (here is where the Basic 3 come in)

        really helps get you a better answer, faster.

        Wayne

         
    • Nobody/Anonymous

      Here we go, I shall try again:

      I am using Dev C++ Version 2, June 1991 on Windows XP

      I am teaching myself to program a graphic lcd. Trying to compile another person's C program. ( http://perso.orange.fr/rs-rey/electronic_ressources/Ressources/8051/GraphicLCD/GraphicLCD.htm ) I don't understand why I don't have a header file that declares variables like U8,U32,sfr,sbit already, if that is what needs to be done. And I don't know how to fix this problem.

      Ex: this is not the program, but bits and pieces of it. The program is too long to put in here. Each "stanza" per say, is one of the parts that gives me errors. I cannot create a simple program with these examples because I don't understand how it works first.

      void GLCD_LcdInit();
      void GLCD_ClearScreen ();
      void GLCD_DisplayPicture (U8);
      void GLCD_Locate (U8, U8);
      void GLCD_Rectangle (U8, U8, U8, U8);
      void GLCD_Printf (U8
      , FONT_DEF*);
      void GLCD_DisplayValue (U32, U8, U8) ;
      void GLCD_Circle(U8, U8, U8);

      / BYTE Registers /
      sfr P0 = 0x80;
      sfr P1 = 0x90;
      sfr P2 = 0xA0;
      sfr P3 = 0xB0;
      sfr PSW = 0xD0;
      sfr ACC = 0xE0;
      sfr B = 0xF0;
      sfr SP = 0x81;
      sfr DPL = 0x82;
      sfr DPH = 0x83;
      sfr PCON = 0x87;
      sfr TCON = 0x88;
      sfr TMOD = 0x89;
      sfr TL0 = 0x8A;
      sfr TL1 = 0x8B;
      sfr TH0 = 0x8C;
      sfr TH1 = 0x8D;

      / BIT Registers /
      / PSW /
      sbit CY = PSW^7;
      sbit AC = PSW^6;
      sbit F0 = PSW^5;
      sbit RS1 = PSW^4;
      sbit RS0 = PSW^3;
      sbit OV = PSW^2;
      sbit P = PSW^0;

      / TCON /
      sbit TF1 = TCON^7;
      sbit TR1 = TCON^6;
      sbit TF0 = TCON^5;
      sbit TR0 = TCON^4;
      sbit IE1 = TCON^3;

      these are the compile errors I'm getting:

      Compiler: Default compiler
      Executing gcc.exe...
      gcc.exe "C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C" -o "C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
      In file included from C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:33:
      C:\Documents and Settings\Elin\Desktop\Bible Comp\/reg51f.h:13: error: `sfr' does not name a type

      C:\Documents and Settings\Elin\Desktop\Bible Comp\/reg51f.h:51: error: `sfr' does not name a type

      C:\Documents and Settings\Elin\Desktop\Bible Comp\/reg51f.h:70: error: `sbit' does not name a type

      C:\Documents and Settings\Elin\Desktop\Bible Comp\/reg51f.h:109: error: `sbit' does not name a type

      In file included from C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:37:
      C:/Dev-Cpp/include/font.h:31: error: U8' does not name a type C:/Dev-Cpp/include/font.h:32: error:U8' does not name a type
      C:/Dev-Cpp/include/font.h:33: error: ISO C++ forbids declaration of U8' with no type C:/Dev-Cpp/include/font.h:33: error: expected;' before '*' token
      C:/Dev-Cpp/include/font.h:36: error: code' does not name a type In file included from C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:38: C:/Dev-Cpp/include/glcd.h:30: error: variable or fieldGLCD_DisplayPicture' declared void
      C:/Dev-Cpp/include/glcd.h:30: error: U8' was not declared in this scope C:/Dev-Cpp/include/glcd.h:30: error: expected primary-expression before ')' token C:/Dev-Cpp/include/glcd.h:31: error: variable or fieldGLCD_Locate' declared void
      C:/Dev-Cpp/include/glcd.h:31: error: U8' was not declared in this scope C:/Dev-Cpp/include/glcd.h:31: error: initializer expression list treated as compound expression C:/Dev-Cpp/include/glcd.h:32: error: variable or fieldGLCD_Rectangle' declared void
      C:/Dev-Cpp/include/glcd.h:32: error: U8' was not declared in this scope C:/Dev-Cpp/include/glcd.h:32: error: initializer expression list treated as compound expression C:/Dev-Cpp/include/glcd.h:33: error: variable or fieldGLCD_Printf' declared void
      C:/Dev-Cpp/include/glcd.h:33: error: U8' was not declared in this scope C:/Dev-Cpp/include/glcd.h:33: error: expected primary-expression before ',' token C:/Dev-Cpp/include/glcd.h:33: error: expected primary-expression before '*' token C:/Dev-Cpp/include/glcd.h:33: error: expected primary-expression before ')' token C:/Dev-Cpp/include/glcd.h:33: error: initializer expression list treated as compound expression C:/Dev-Cpp/include/glcd.h:34: error: variable or fieldGLCD_DisplayValue' declared void
      C:/Dev-Cpp/include/glcd.h:34: error: U32' was not declared in this scope C:/Dev-Cpp/include/glcd.h:34: error:U8' was not declared in this scope
      C:/Dev-Cpp/include/glcd.h:34: error: initializer expression list treated as compound expression
      C:/Dev-Cpp/include/glcd.h:35: error: variable or field GLCD_Circle' declared void C:/Dev-Cpp/include/glcd.h:35: error:U8' was not declared in this scope
      C:/Dev-Cpp/include/glcd.h:35: error: U8' was not declared in this scope C:/Dev-Cpp/include/glcd.h:35: error: initializer expression list treated as compound expression C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:43: error: variable or fieldLcdSelectSide' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:43: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:44: error: variable or fieldLcdDataWrite' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:44: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:45: error: variable or fieldLcdInstructionWrite' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:45: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:46: error:U8' does not name a type
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:47: error: variable or field LcdSetDot' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:47: error:U8' was not declared in this scope
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:47: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:47: error: initializer expression list treated as compound expression C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:49: error: variable or fieldLcdDelay' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:49: error: U32' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:50: error: variable or fieldLcdPutchar' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:50: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:50: error: expected primary-expression before '*' token C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:50: error: expected primary-expression before ')' token C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:50: error: initializer expression list treated as compound expression C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:53: error:xdata' does not name a type
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:63: error: variable or field LcdDelay' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:63: error: redefinition ofint LcdDelay'
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:49: error: int LcdDelay' previously defined here C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:63: error:U32' was not declared in this scope
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:64: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C: In function void GLCD_LcdInit()': C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:75: error:P2' undeclared (first use this function)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:75: error: (Each undeclared identifier is reported only once for each function it appears in.)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:76: error: P0_0' undeclared (first use this function) C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:77: error:P0_1' undeclared (first use this function)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:78: error: P0_2' undeclared (first use this function) C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:79: error:P0_3' undeclared (first use this function)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:80: error: P0_4' undeclared (first use this function) C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:82: error:P0_5' undeclared (first use this function)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:83: error: LcdDelay' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:85: error:LcdDelay' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:88: error: LcdSelectSide' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:89: error:LcdInstructionWrite' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:90: error: LcdInstructionWrite' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:91: error:LcdInstructionWrite' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:92: error: LcdInstructionWrite' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:93: error:LcdInstructionWrite' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:95: error: LcdSelectSide' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:96: error:LcdInstructionWrite' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:97: error: LcdInstructionWrite' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:98: error:LcdInstructionWrite' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:99: error: LcdInstructionWrite' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:100: error:LcdInstructionWrite' cannot be used as a function

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C: At global scope:
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:110: error: variable or field LcdSelectSide' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:110: error: redefinition ofint LcdSelectSide'
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:43: error: int LcdSelectSide' previously defined here C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:110: error:U8' was not declared in this scope
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:111: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:141: error: variable or field LcdDataWrite' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:141: error: redefinition ofint LcdDataWrite'

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:44: error: `int LcdDataWrite' previously defined here

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:141: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:142: error: expected,' or ;' before '{' token C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:159: error: variable or fieldLcdInstructionWrite' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:159: error: redefinition of int LcdInstructionWrite' C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:45: error:int LcdInstructionWrite' previously defined here
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:159: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:160: error: expected,' or ;' before '{' token C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:176: error:U8' does not name a type
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C: In function void LcdWaitBusy()': C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:197: error:P2' undeclared (first use this function)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:199: error: P0_0' undeclared (first use this function) C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:200: error:P0_1' undeclared (first use this function)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:202: error: `P0_2' undeclared (first use this function)

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:203: error: `LcdDelay' cannot be used as a function

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C: In function void GLCD_ClearScreen()': C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:216: error:xdata' undeclared (first use this function)
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:216: error: expected ;' before "U8" C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:217: error: expected;' before "U8"
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:220: error: u8Page' undeclared (first use this function) C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:222: error:LcdSelectSide' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:223: error: LcdInstructionWrite' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:224: error:LcdInstructionWrite' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:227: error: u8Column' undeclared (first use this function) C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:231: error:LcdSelectSide' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:232: error: LcdInstructionWrite' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:233: error:LcdInstructionWrite' cannot be used as a function
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:235: error: LcdDataWrite' cannot be used as a function C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C: At global scope: C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:245: error: variable or fieldGLCD_DisplayPicture' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:245: error: redefinition of int GLCD_DisplayPicture' C:/Dev-Cpp/include/glcd.h:30: error:int GLCD_DisplayPicture' previously defined here
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:245: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:245: error:au8PictureData' was not declared in this scope
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:246: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:275: error: variable or field LcdSetDot' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:275: error: redefinition ofint LcdSetDot'
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:47: error: int LcdSetDot' previously defined here C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:275: error:U8' was not declared in this scope

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:276: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:318: error: variable or field LcdPutchar' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:318: error: redefinition ofint LcdPutchar'
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:50: error: `int LcdPutchar' previously defined here

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:318: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:318: error: expected primary-expression before '*' token C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:318: error:toto' was not declared in this scope
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:319: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:399: error: variable or field GLCD_Printf' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:399: error: redefinition ofint GLCD_Printf'

      C:/Dev-Cpp/include/glcd.h:33: error: `int GLCD_Printf' previously defined here

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:399: error: U8' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:399: error:au8Text' was not declared in this scope
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:399: error: expected primary-expression before '*' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:399: error: toto' was not declared in this scope C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:400: error: expected,' or ;' before '{' token C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:414: error: variable or fieldGLCD_Locate' declared void
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:414: error: redefinition of int GLCD_Locate' C:/Dev-Cpp/include/glcd.h:31: error:int GLCD_Locate' previously defined here
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:414: error: `U8' was not declared in this scope

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:415: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:429: error: variable or field GLCD_DisplayValue' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:429: error: redefinition ofint GLCD_DisplayValue'
      C:/Dev-Cpp/include/glcd.h:34: error: int GLCD_DisplayValue' previously defined here C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:429: error:U32' was not declared in this scope
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:429: error: `U8' was not declared in this scope

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:430: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:473: error: variable or field GLCD_Rectangle' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:473: error: redefinition ofint GLCD_Rectangle'
      C:/Dev-Cpp/include/glcd.h:32: error: int GLCD_Rectangle' previously defined here C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:473: error:U8' was not declared in this scope

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:474: error: expected ,' or;' before '{' token
      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:499: error: variable or field GLCD_Circle' declared void C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:499: error: redefinition ofint GLCD_Circle'
      C:/Dev-Cpp/include/glcd.h:35: error: int GLCD_Circle' previously defined here C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:499: error:U8' was not declared in this scope

      C:\Documents and Settings\Elin\Desktop\Bible Comp\GLCD.C:500: error: expected ,' or;' before '{' token

      Execution terminated

      sorry if it is too long...

       
    • Wayne Keen

      Wayne Keen - 2007-01-17

      I ama a little unclear on why you expect this code to compile under windows.

      Are you trying to cross compile for another platform?

      "I am using Dev C++ Version 2, June 1991 on Windows XP"

      Are you sure? Where did you get that?

      Wayne

      p.s. Unrelated not - keeping you code in paths with spaces will cause
      you problems

       
    • Wayne Keen

      Wayne Keen - 2007-01-17

      Considering MinGW didn't start until 1998, I really doubt the version information
      you posted. I know of no version 2 either.

      The current version of Dev is 4.9.9.2, its on the frame of the Dev window

      Wayne

       
    • Nobody/Anonymous

      Without going thro' the error messages but simply looking at the code snippets
      and the link to the source it seems as tho' this is pure 8051 stuff. i.e. a microcontroller to drive a standalone graphic display.

      Indeed, the link even goes so far as to tell you it's using the Keil compiler.

      AFAIK DevC++ is not a cross compiler and uses only the GNU C and C++ compilers.

      In other words DevC++ and its associated compiler just won't do what you want of it.
      Which is a pity because I would have used it years ago if it could've handled 8051 code
      using the Keil compiler :)

      Derek L.G. Mason

       
      • Wayne Keen

        Wayne Keen - 2007-01-19

        Hi Derek,

        Yep, I actually went to the site and saw the platform it was for, that was
        why I asked (I thought pretty gently) whether they were using Dev as a
        cross compiler...

        Wayne

         
    • Anonymous

      Anonymous - 2007-01-19

      sfr stands for Special Function Register, teht refer to registers in a particular microcontroller.

      I would suggest that compiling some random code from the web is not a good way to learn, expecially whan you have no clue what that code is or does! This code is targetted at an 8bit microcontroller and is not PC code. That should be obvious - where is the graphic LCD display on your PC!?

      If your intent was in fact to write embedded systems code, and you do indeed have a microcontroller board with an LCD, it might have been relevant to mention that in the first instance, if not you really are lost!

      For 8bit microcontrollers you might use http://sdcc.sourceforge.net/ or for Atmel AVR devices, there is a GNU gcc variant: http://winavr.sourceforge.net/

      Either way "C:\Documents and Settings\Elin\Desktop\Bible Comp" is not a good place to place your project code. Dev-C++ and other tools I have come across (including cross-compilers) have problems with paths with spaces in.

      Clifford

       
    • Wayne Keen

      Wayne Keen - 2007-01-19

      The OP did state, in his followup post:

      "I am teaching myself to program a graphic lcd."

      But it was not at all clear to me whether he

      (1) Was trying to use baseline Dev as a cross compiler

      or

      (2) He was using a special build of Dev he found somewhere. (You remember the porno guy who was putting out something he called Dev-C++ for example)

      or

      something else.

      As Clifford hinted, we see a number of people here who are trying to learn basic programming by taking essentially random example programs, and trying to compile them - then posting here when they don't compile out of the box. We had one dude here a few years back that for a couple of weeks was posting several times a day in a cycle of

      (1) Find random example code
      (2) Paste it into Dev and compile
      (3) On getting an error, don't look at the error, just post it and ask "What's wrong and how do I fix it"
      (4) Goto 1

      This approach to learning never seems to work, and it wastes the time of the people they ask for help. Hence a certain allergy to the "Compile and hope" school of learning.

      Wayne

       
    • Nobody/Anonymous

      Dr. Wayne, Clifford, OP

      I was perhaps inclined to the view that the OP hadn't seen it for what it is and therefore might want a slightly stronger hint :)

      <advert> Codeblocks </advert> in fact will act as an IDE for SDCC (MCS51 / Pic etc) as well as PC native code. So in theory you can use the same IDE to test an algorithm on your PC screen and then port it directly to your chosen target.

      Not really quite that simple but you get the idea....

      However I feel that I must point out, lest the OP gets the idea that this is all quite simple, that the original sources were written for the Keil compiler. There's a lot of compiler specific code here that would not work with SDCC and a goodly amount of work may be necessary to sort it out. Cross compilers for small targets like this aren't really ANSI compliant. Some of them aren't even K&R :) And we'll say nothing about ECPP....

      BTW the SDCC forum is a good place to look at resolving the issues of 8051 sources written for Keil and then ported to SDCC

      Derek L.G. Mason

       
    • Anonymous

      Anonymous - 2007-01-19

      >> DevC++ is not a cross compiler and uses only the GNU C and C++ compilers.

      Dev-C++ is not a compiler at all, it can however be used with GNU GCC cross-compilers, such as WinAVR, WinARM, and any number of Cygwin based cross-compilers. I am not sure if SDCC's command line interface is sufficiently GNU like to be easily used with Dev-C++. It is true that Code::Blocks and more commonly Eclipse are more easily adapted to alternative compilers. However I somehow think that this discussion will be lost on the OP.

      Clifford

       
      • Wayne Keen

        Wayne Keen - 2007-01-19

        I suspect that the OP is long gone.

        Wayne

         
    • Nobody/Anonymous

      I know Dev-C++ is an IDE and not a compiler.

      It just shows how easy it is to fall into that trap when not paying attention. :)~
      I don't suppose I'll be the first/last either.

      But I agree, I 'spect the OP's long gone.

      Derek (Del)

       
      • Anonymous

        Anonymous - 2007-01-20

        My point was rather that Dev-C++ can be used with a cross-compiler, so being Dev-C++ does not preclude cross compilation - Just to be clear. It was not meant as a correction, and was probably a pedantic point, but it might be useful to some to know that Dev-C++ can be used in this way.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.