Bugs that have been investigated and resolved somehow.
Moderator: GZDoom Developers
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here
- Posts: 428
- Joined: Sat Jun 23, 2012 7:44 am
- Graphics Processor: nVidia with Vulkan support
- Location: Czech Rep.
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
Including library.zs directly in the main ZS file (omitting the library's includes file) works fine:
Code: Select all
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?
- Lead GZDoom+Raze Developer
- Posts: 48873
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
That's due to how includes get processed in ZScript. This is not a preprocessor that pulls in the text. It merely adds the file to the end of the list of script files to compile.
What this means is that your files get processed in the wrong order, as
gets parsed before
and therefore compiled before the library. This is a technical limitation of how the compiler works so it's not really fixable.