I’m starting to run out of options here, no matter what type of script I attempt to add, I always get the following error when building the solution: “error LNK2019: unresolved external symbol “void __cdecl AddSC_alliance_boss(void)” (?AddSC_alliance_boss@@YAXXZ) referenced in function “void __cdecl AddCustomScripts(void)” (?AddCustomScripts@@YAXXZ)”.
I have added it to the scriptloader file
[SPOILER]#ifdef SCRIPTS
/* This is where custom scripts’ loading functions should be declared. */
void AddSC_alliance_boss(); #endif
void AddCustomScripts()
{ #ifdef SCRIPTS
/* This is where custom scripts should be added. */
AddSC_alliance_boss(); #endif
Try the config&generate. Not sure what and when the automation does it, but usually ppl who dont run it themselves get these problems, so run it anyways.
However ppl keep saying that and I decied to test. If you add a script to cmakelists, then it will need the complete rebuild it would seem. If you simply change an existing script, then it wont make a full recompile, but possibly does if you use cmake in between.
What I found to be weird when testing was that using cmake seemed to make the whole core rebuild even if logically adding one cpp file shouldnt do that.
I made a diff of the changes cmake does when adding a trivial script to the TC source. I think there is something wrong here: https://gist.github.com/Rochet2/e0d8e894ab21e7836a71#file-build-diff-L742-L756
In the diff the actual changes for the script are like 2 lines and all others are adding warning disables and other that are already there. I feel like this could be a bug in cmake or the TC cmake code.