I’ve recently ran into an error when attempting to compile scripts, that have already been compiled, but are now unable to because of this known error ERROR: FUNCTION DEFINITION MISSING NAME.
I read the cause of this is quite common when trying to name variables/functions with similar names cause compilation errors. Others have just experienced it without any rhyme or reason and can not resolve it at all
This is my situation.
Several scripts that involve #include “nw_i0_plot” have seem to been broken somehow and the cause is the function above. The error points to nw_i0_tool. I have tried changing the #include to anything that uses i0_tool and change it plot and vice versa
I understand this is a known issue, but why would it just happen all of a sudden without any solution
I have tried building and compiling everything, going to each of the scripts that use both of these files and removing it, but it constantly comes back to nw_i0_tool.
Any help would be greatly appreciated!
Thanks in advance
The error may simply mean that a variable is defined twice - DC_EASY looks like the culprit.
Worth double-checking that nothing redefines DC_EASY, or includes nw_i0_tool (explicitly or implicitly) because it’s a known issue that it duplicates elements of nw_i0_plot.
Sounds like you already did that, but, on the face of it, something is including nw_i0_tool.
Sometimes restarting the toolset clears spurious include errors, but somehow I don’t think this is one of those cases.
Have you tried any of the community-made compilers?
As far as I can tell nothing in the base game includes that file so check where in your includes and scripts it’s getting pulled in from. Then check what’s right before that. This is the first real line in that nw_i0_tool so I’d guess there is likely a missing ; or something similar at the end of the file included immediately before this one.
Is this 1.69 or EE? The is also a limit on the number of symbols that can be defined in 1.69 in-box in a single compilation unit. I think that may have been fixed in EE though. But once you include and define enough stuff in a script it can cause really odd compiler errors in otherwise fine code. I’ve never hit that on the first line in a file but I suppose it could happen there.
I apologize for not clarifying that I am using the Diamond collection of NWN 1.69
However, I found the culprit that was causing the error and ill share it here so anyone who is perplexed by this as I was, can find it
The error was being caused by including nw_i0_tool in one script and nw_i0_plot in another. The function that was being accessed was TakeGold() in nw_i0_plot. Oddly, this caused the error above because nw_i0_tool was being used in another
It took me time to figure out, but I found it by compiling all scripts using the Build function and then looking at each script
I didnt mean to waste anyones time, but hopefully this can shed light on any modders who are experiencing this
Thank you for your replies and assistance!