Defining globals in multiple source files can result in a build error
o The Environment:
Windows 7
Eclipse Neon.2 (4.6.2)
ConnectIQ 2.2.3
o A detailed description of the issue
If there are dynamically initialized globals in multiple source files, and the declaration occurs on the same line of both files, the compiler will generate an unexpected error. This appears to occur because the name of the label that is generated by the compiler depends only on the application name and the line number of the declaration.
It seems that this problem could be resolved by naming the label after the source file containing the global, or by collapsing the declarations of all global scope variables under one initialize label.
o Steps to reproduce the issue
Build and run the test code provided. An error similar to the following will be produced.
ERROR: ERROR:stdin:171: Redefinition of label (code) source_XApp_mc_2_0
If you build with --debug, you'll see the following in the output.
globals_<init>:
source_XApp_mc_2_0:
lgetv 0
spush AConst
ipush 1
putv
source_XApp_mc_2_0:
lgetv 0
spush BConst
ipush 4
putv
return
o Any applicable additional information
None.
o A code sample that can reproduce the issue (in email only if preferred)
https://1drv.ms/u/s!Ak71bikqehCh1jGsSn5_rcvjCTwY