May i use the same variable placed in a library and in the main program at the same time???

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

May i use the same variable placed in a library and in the main program at the same time???

1,893 次查看
mauricio2346
Contributor II
Hi.

i want to control two diferent actions with IRQ interrupt, creating a variable (Estado) in two functions placed in a library i made.  when one of them is used in the main program, Estado's values is 1 ( in the library),  with othe function  its value is -1 (estado).  when i try to use Estado in the main program it recognizes the word Estado (changing text's color to bright blue), but when i check the program (F7), it say that Estado is not declared.  How can i do that????  it can be made by another way??? thanks!
标签 (1)
0 项奖励
回复
1 回复

626 次查看
CrasyCat
Specialist III
Hello
 
You need to do a proper definition for the variable somewhere in the application.
 
Are you linking the library with your application?
Is estado defined in somewhere in the library (something like (int estado:smileywink: or do you have only external declaration for it (extern int estado:smileywink:?
 
CrasyCat
0 项奖励
回复