arduino mega 2560 using sketch: error message serial port does not exist

That has NOTHING to do with the code failing to compile. It DID compile and link. It failed to upload is all. Have you ever been able to upload a sketch?