Before building the program, make sure you select the standard mode, not the simulation mode, on the toolbar.
Build the entire program before downloading it to your PLC.
Choose Build → Rebuild All Project to build the program:
The program should build without errors.