Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Identifier is undefined error in keil

Status
Not open for further replies.

dizgah

Member level 5
Joined
Nov 8, 2009
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
iran-8par
Activity points
2,049
hi every one
as i said past im trying to port osama GLCD library to keil for using with stm32f103 mcu
i am using prevlet variable in a glcd_putchar function but keil shows :
identifer"prevlet" is undefined
& its while that im declare this variale as global variable
Code:
unsigned char prevLet = 193;
is there any one for helping me?
i attached source code too & thanks
 

Attachments

  • GLCD.zip
    1.2 MB · Views: 95

prevLet and prevlet is a different variables
thanks dear Easyrider83
its about my typing fault,both of them were prevLet in program,altough the error was about comments in libary & with clearing them ,error eliminated too.
any way here i have a new error too :
symbol font multiply defined
&
symbol map multiply defined
its as i usd #ifndef # def preprocessor instructions & dont know reason of this error,i attached my program in keil & hope some body help me in doing this
tnks again
 

Attachments

  • GLCD.rar
    1.1 MB · Views: 89

Use independend .h file (or better .c) for store and declare const variables like a font or raw image.
 
  • Like
Reactions: dizgah

    dizgah

    Points: 2
    Helpful Answer Positive Rating
The bad practice is essentially to have a variable or constant memory object defininition in an include file. The "#ifndef xxx #define xxx" method avoids conflicts from multiple definitions within the compilation of a single source file. But it still creates multiple memory objects when their definition is included in multiple source files.

The solution is to move the map and font definition to glcd.c and add respective extern declarations to glcd.h.
Code:
extern const unsigned char font[];
extern const unsigned char map[62][6];

It might be that some compilers are automatically removing doubled definitions, but the C standard requires to follow the said scheme.
 
  • Like
Reactions: dizgah

    dizgah

    Points: 2
    Helpful Answer Positive Rating
thanks for your replyes
with your guides i eliminated the errors, but completely i dont undrestand your minds8-O
can you please explain more or give me some links about it ?
: )
 

The difference between definition and declaration should be explained in any C text book, e.g. Kernighan & Ritchie, The C language.
 
  • Like
Reactions: dizgah

    dizgah

    Points: 2
    Helpful Answer Positive Rating
Read the book "Computer Science A Structured Programming Approach Using C" by Behrouz A. Forouzan and Richard F. Gilberg. This is the best book to learn C Programming.
 

hi every body again :lol:
i eliminated all of errors,program compiled correctly but it dosent affect on lcd(lcd dosent show any thing)
i debug it in keil & it seems instructions dosent affect to gpio ,for example gpio_config or setbit/reset bit & others dosent work (i dont see change in GPIOC debugging section)
ex cuse me but can any one please see code & help me again ?
WBR
 

Attachments

  • GLCD.rar
    1.1 MB · Views: 104

I don't see any gpio_init() performed in your code.
 
  • Like
Reactions: dizgah

    dizgah

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top