compiler limit exceeded while assembling user class; 255 fields allowed connect iq 258 used

Hi

SDK 3.1.4 on windows 10

I have a watch face program with this message when i compile the WF.

What is 255 fields   in my program

strings ? settings ? Property ? , variables in program

I understand the problem but i don't know where i must work to fix the problem

Where i can count this counter for other program whitch work correctly actually

Thanks for your help

Didier

Top Replies

  • I have numerous metrics where users should be able to choose from, but each metric requires a string.

    I have a similar problem for my datafields which support 100+ metrics (if you count modifiers…

  • Cutting back the number of stings by 3 to get back to 255 is the quickest solution right now.

    You realize that the original question about 258 strings is from 4 years ago (you responded to…

All Replies

  • It would've been great if:

      - you could create settings without string resources and use hard coded strings instead....

    - These string resources didn't impact the runtime memory usage of your app

    Either/or.

    Seems like the goal of requiring string resources for settings is to try to "encourage" CIQ devs to localize their settings strings (same idea behind the FIT contributor metadata, where labels and units have to be string resources.) Or maybe just to give devs that option, if they want/need it.

    It would be no problem if CIQ would provide a separate resource section for settings-specific strings, so their IDs wouldn't waste app memory when you load at least one resource at runtime.

  • Thanks! Creating a hierarchie could bring some order as well. Good workaround

  • Thing is, a change like this wouldn't be quick, and would mean changes to device FW (the VM), which might not make it into older FW,

    As it looks like you are only a few over 255, have you looked as using the exact same stings for things in settings and used at run time?  If you have a string for "Lap Time" in settings and another string "Lap Time" for runtime, you can use the same sting for both and eliminate one. 

    I have a couple apps where the stings I use at runtime are the exact same ones I use in settings.  I was no where close to the 255, but wanted to see how easy this could be done.

    Let's say you have 7 strings for something like the day of the week.  Just have a single string like "Sun,Mon,Tue,Wed,Thu,Fri,Sat", and do a simple parse in your app, maybe saving it as an array of strings, one string per day for faster access later on..

  • hi,

    what you could do also to save strings in settings:

    I had for example

     - Pressure Format =>settings list)

    -----HPA

    -----InHg

    -----mmHG

    so here 4 strings

    I did

    - Pressure Format (1=HPA, 2=InHg, 3=mmHg) => numeric box

    so here 1 string but less frindly user

  • Thing is, a change like this wouldn't be quick, and would mean changes to device FW (the VM), which might not make it into older FW,

    Which change are you referring to specifically?

    - allowing more strings in CIQ? (When I said that, I didn't think it would actually happen - maybe I should've made that clear)

    - allowing settings-specific strings to live in a dedicated section that isn't available to the app at runtime?

    - allowing settings to use hardcoded strings?

    It seems that the latter 2 ideas are actually the rare kind of proposed design change which could be implemented without changing the firmware at all; ideally, the compiler/linker and CIQ store would have to change, but not the firmware.

    But let's be real, we all know none of those things are going to happen.

  • The the first two, yes, FW changes.  The 3rd one, maybe.

    more stings means adding a second byte to the id.  it's 255 now as that's the max in 8 bits.

    Separating things could also break existing apps that use the same stings in settings and at run time.  There is nothing that prevents that today.  You may not do common stings, but I do..

    Cutting back the number of stings by 3 to get back to 255 is the quickest solution right now.

  • more stings means adding a second byte to the id.  it's 255 now as that's the max in 8 bits.

    Yes, you explained that several times. We all understand that the largest number that can be represented by a byte / 8 bits is 255.

    Like I said, that wasn't really a serious suggestion. In that case, I literally meant "it would have been great if more resources were allowed", not "I think more resources should be allowed". Again, I sincerely regret not making that abundantly clear.

    The the first two, yes, FW changes. 

    I don't see how the 2nd suggestion (allow some string resources to be in a separate section) necessarily requires a firmware change. If the compiler/linker is changed to create a new section for string resources which aren't needed at runtime, this section could go somewhere that the firmware would never see (e.g. a separate file, which is still uploaded to the store).

    Separating things could also break existing apps that use the same stings in settings and at run time.  There is nothing that prevents that today.  You may not do common stings, but I do..

    That's why it's also been suggested that this separation would be *opt-in*.

    - allowing settings-specific strings to live in a dedicated section that isn't available to the app at runtime?

    Key word: allowing (not mandating)

    It's been discussed at length more than once in the past, but the idea is that the developer would opt-in to placing string resources in some sort of dedicated section that wouldn't be available to the app at runtime. This could also be use for other things, like string resources that are only used for FIT labels and units.

    Conceptually, I don't see why this kind of thing requires a firmware change.

    Simple analogy / example:

    - A change is made to the Connect IQ infrastructure which allows devs to include store description, changelog, listing image and screenshots as part of the IQ package, so that devs can automate/script the app update process if they choose. The compiler/linker has to change, the store has to change, but firmware doesn't have to change, because the firmware would never see any of that additional data.

  • Cutting back the number of stings by 3 to get back to 255 is the quickest solution right now.

    You realize that the original question about 258 strings is from 4 years ago (you responded to it at the time), there was a subsequent comment from 4 months ago about 257 strings, and the latest comment is about an unspecified number of strings for settings?

    This is why I think that threads should be locked after a certain amount of time (*). Old threads from years ago get resurrected and they become hard to follow or people reference outdated information.

    EDIT: (*) One obvious exception is threads in the Connect IQ Showcase.

    I bumped into this error also: I use too much strings for all the settings that my Datarun ultimate datafeikd had. I have numerous metrics where users should be able to choose from, but each metric requires a string.

    So if GHG23 literally has more than 255 strings that are mostly for settings, it may be impossible to just "cut back on the number of strings" in a straightforward way like you suggested, unless they also cut back on the number of settings or settings enums (which was a solution suggested by me and someone else).

    So we've all already suggested practical workarounds.

    The other comments are about what Garmin could do to help us avoid this problem in the future, although we know it won't happen. I have a selfish interest in my suggestion for separate non-runtime resources, which would help free up memory for older devices (and even current devices like Vivoactive 4) which have a limited amount of memory for data fields. I just want to be able to pack as many features as possible into CIQ data fields for less capable watches. I also want to be able to update my apps without worrying about out-of-memory errors on older watches.