In reply to UVM_LOVE:
build_phase is a class method of the class uvm_agent in your case, but it is not a data member of uvm_agent. In general it is the build_phase of one of the bas classes contained in the UVM library.
In your code example there might be something wrong, like a missing semicolon, because your error message is pointing to the wrong place.