The text in red does not actually tell you what is wrong with the code, it simply tells you that the build failed. The error messages in white before it is what tells you what is wrong with the code. Could you copy-paste them here?
Looking at the last two error descriptions, it looks like the compiler doesn't know about the ns3 class "Simulator". Do you have ' #include "core-module.h" ' and ' using namespace ns3 ' lines at the beginning of your source file?