Zabdy Rocha
Hello, I'm having trouble compiling my program. It seems to be a problem with external variables.
 
I removed the external variable and the program compiled successfully, allowing me to load it onto my board. If I reinsert the external variable, the problem persists.
 
Please help me resolve this.
 
[203128%2F9283559%2Fmceclip0]
 
[203128%2F9283560%2Fmceclip0]
 
[203128%2F9283556%2Fmceclip0]
 
C:\Users\Zabdy Rocha\OpenPLC_Editor\editor\arduino\src\POUS.c: In function 'PROGRAM0_init__':
editor\arduino\src\lib/accessor.h:71:30: error: implicit declaration of function '__GET_GLOBAL_COUNT_1' [-Wimplicit-function-declaration]
71 | name.value = __GET_GLOBAL_##global();\
| ^~~~~~~~~~~~~
C:\Users\Zabdy Rocha\OpenPLC_Editor\editor\arduino\src\POUS.c:11:3: note: in expansion of macro '__INIT_EXTERNAL'
11 | __INIT_EXTERNAL(INT,COUNT_1,data__->COUNT_1,retain)
| ^~~~~~~~~~~~~~~
editor\arduino\src\lib/accessor.h:71:28: error: assignment to 'IEC_INT *' {aka 'short int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
71 | name.value = __GET_GLOBAL_##global();\
| ^
C:\Users\Zabdy Rocha\OpenPLC_Editor\editor\arduino\src\POUS.c:11:3: note: in expansion of macro '__INIT_EXTERNAL'
11 | __INIT_EXTERNAL(INT,COUNT_1,data__->COUNT_1,retain)
| ^~~~~~~~~~~~~~~
Reply 0 0
thiagoralves
Update your editor and it will work
Reply 0 0
martinez20m
Hello,
I have similar problem with compiling using global variables. It is for rpipicow. Also I'm using newest version of editor.
Please help me with resolving this issure.
Thanks in advance
 
compile_error.png
Reply 0 0
Balmazo
Hallo,
Im facing the same problem.
I have already updated the Editor, Im on the latest version.
 
[203128%2F9298099%2Fmceclip0]
 
[203128%2F9298100%2Fmceclip0]
 
[203128%2F9298103%2Fmceclip0]
 
[203128%2F9298110%2Fmceclip0]
Reply 0 0
thiagoralves
Move your global variables from Res0 to your project name (sem nome in your case)
Reply 0 0
martinez20m
I didn't post all my windows, sorry. Moving global variables from Res0 to project name work! Thank you😉
Reply 1 0
Balmazo
Thats it!!!
Thank you so much for the quick response and solution.
Reply 0 0
erjohnson227
Hey there, I tried doing what you mentioned and moving all globals to be under the project name, no luck, same errors. I get this error for every one of my global variables.
Reply 0 0
Reply