Make sure you modify all necessary files, your error is a result of this. When creating a weapon you need to add code to ev_hldm.cpp, evhldm.h, hl_events.cpp, hl_weapons.cpp and those are on the client side.
On the server side you also need to look at weapons.cpp and weapons.h and this is also where you need your example.cpp.
Finally make sure the client shares your example.cpp by just adding the file to the client. The last thing I think is the event file. Just copy and modify one from another weapon. Those are located in your mods files and if it's not then just create a folder called events and copy some other weapon from any mod and then edit the file.
Well I'm not writing a tutorial here so I better stop haha. Hope I could help.