3d party Barrel - can't get it to work

I want to use this barrel in my App project: https://github.com/douglasr/msgpack-monkeyc

My IDE is VSCode on MacOS, current version both for VSCode as for teh Monkey C extension. Git installed and working.

This is what I did:

1. Cloned the GitHub repo to my local folder.

2. Built the barrel in VSCode: Monkey C: Build Current Project. This resulted in a .barrel and a .barrel.debug.xml file in the /bin directory.

3. Ran the test in VSCode: Monkey C: Run Tests. This worked ok.

4. Opened my App folder.

5. Added the barrel to the project with Monkey C: Configure Monkey Barrel, selected the .barrel file

6. Added a call to a function in the barrel as per the instruction in the README

But, no matter what I try, the app does not compile. The compiler complains: "edge1050: Undefined symbol ':pack' detected." referring to the source code line in my app where the function is called:

var packed_poiSet = MessagePack.Serialize.pack(_poiSet);

Also there's a lot of similar errors, all refering to code lines in the test source.

I followed all instructions as docuemnted by Garmin and the author of the barrel to the letter, but it does not compile.

Obviously I am missing something which is not documented. Or maybe it is but I missed it.

Any help is appreciated.

  • So, after could successfully compile my code I proceeded to add Mesagepack.Serialize.pack(); to my code as per the README. However it didn't work. I had the following error in the console (statement as in the start post):

    Error: Illegal Access (Out of Bounds)
    Details: Failed invoking <symbol>

    I thought there would maybe be a problem with the _poiSet I wanted to pack so I checked in the debugger but found nothing wrong. Tried some alternative ways but to no avail. By then I was quite frustrated by the experience so I dropped the thing for a few months.

    Today I picked it up again and tried a simplified packing call, at exactly the same place in the code:

    var packed_poiSet = MessagePack.Serialize.pack("Hello world!");

    This resulted in the same runtime error:

    Error: Illegal Access (Out of Bounds)
    Details: Failed invoking <symbol>

    Given the fact that the argument to my call is a string literal, my conclusion is that the <Symbol> refers to the MessagePack.Serialize.pack() call, which is apparently 'out of bounds'.

    So again, I am stuck. The compiler accepts the statement so I assume MessagePack can be found. So why can it not be invoked at runtime? What does it mean - 'out of bounds'? What bounds?

    Any help is appreciated.

  • And of course, immediately after posting the question had the idea of doing a search on the out of bounds error. It seems that it may be caused by my source code being in glance: scope while the MessagePack barrel is not. So now the question is - how to add a barrel to glance: scope?