I'm using a ZScript library that comes with its own file full of #includes. I wanted to extend one of its classes so that updating the library wouldn't cause issues. I put my extensions into a separate file and #include it after the library. However, I receive an error that the class to be extended could not be found in the current translation unit.
This approach doesn't work:
Main ZScript file:
Code: Select all
#include "library/includes.zs"
#include "zscript/extensions.zs"
includes.zs:
Including library.zs directly in the main ZS file (omitting the library's includes file) works fine:
Code: Select all
#include "library/library.zs"
#include "zscript/extensions.zs"
For the modder it's easy to just put all #includes into one file, so the severity of this is more or less zero, and a fix doesn't sound worth the trouble (how often do you access your main ZScript file?), but I couldn't find a mention of this. Should it be clarified in the
wiki article for future reference?