Build failed with new script

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

[/SPOILER]and also the cmakelists

[SPOILER]set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
Custom/alliance_boss.cpp
)

message(" → Prepared: Custom")

[/SPOILER]

show the AddSC_alliance_boss function definition from Custom/alliance_boss.cpp

Did you run cmake before compiling? (configure & generate)

Uh… I thought visual studio did that. Does it only generate?

http://pastebin.ca/3210188

Uh… I thought visual studio did that. Does it only generate?

http://pastebin.ca/3210188

​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.

​Yea… using cmake manually did the trick. sadly, now I have to rebuild the whole core each time I add a new script

Usually it shouldnt do that.

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.

@Rochet2 your issue was fixed in https://github.com/TrinityCore/TrinityCore/commit/0946fcf2aa35ebe0b8db07813315e3d6546b9d31

I assume that is only on 6.x?
I tested on 3.3.5 https://github.com/TrinityCore/TrinityCore/commit/981e764004cc8b09c8f29205d9675bfd6e02ae7b

Would be great to have a port /emoticons/default_smile.png

Just the cherry pick is missing

on newest TC its now cherry picked. :slight_smile: