i am jus getting started but iam facing some code errors

my start up procedure is as followes

1) downloaded arduino exe file

2) downlodaded MRLCOMM librarie

3) attached mrlcomm to arduino exe file(and checked in sketchup)

4)mrl jar file downloaded

5) arduino mega 2560 connected and selected in arduino exe file

6) mrl jar file opened

7) upgraded mrl jar file(GUI)

8) installed all

9)right click on Arduino and cliked Start , given a file name

10 ) a setup code generated and copied the same

11) pasted in arduino exe under ( put your setup code here, to run once:) this msg and excuted asked for save and saved the file showng the following error in arduino exe (GUI) file.

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
 
sketch_jul10a.ino: In function 'void setup()':
sketch_jul10a:299: error: type 'setup()::servo_type' with no linkage used to declare function 'void sendServoEvent(setup()::servo_type&, int)' with linkage [-fpermissive]
sketch_jul10a:300: error: type 'setup()::sensor_type' with no linkage used to declare function 'long unsigned int getUltrasonicRange(setup()::sensor_type&)' with linkage [-fpermissive]
sketch_jul10a:305: error: a function-definition is not allowed here before '{' token
sketch_jul10a:313: error: a function-definition is not allowed here before '{' token
sketch_jul10a:316: error: a function-definition is not allowed here before '{' token
sketch_jul10a:326: error: a function-definition is not allowed here before '{' token
sketch_jul10a:1145: error: expected '}' at end of input
type 'setup()::servo_type' with no linkage used to declare function 'void sendServoEvent(setup()::servo_type&, int)' with linkage [-fpermissive]
 
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
 can anybody help me please