[error]: make process closed with exit code : 2 (Help)

Hello, I am making this post to see if anybody can help me with an error while compiling my code. I’ve already troubleshooted the cord, computer, and brain, so it has to be something wrong inside of my VEXcode Pro V5. I am fairly new to coding, but most of this is transferred directly from blocks, and there are no console errors, warnings, or info. Also, sometimes when trying to upload the code, there’s a message that pops up with a warning sign that says, “Building, Error”
I have the output, code, and terminal in the replies.

The code’s tasks are to

  1. Set all motor parameters to 100% (Taken from Blocks code)
  2. Name certain motors
  3. Bind multiple motors to one button (Taken from Blocks code)

Code:

/*----------------------------------------------------------------------------*/
/*                                                                            */
/*    Module:       main.cpp                                                  */
/*    Author:       C:\Users\lrhoda0178                                       */
/*    Created:      Sat Jan 23 2021                                           */
/*    Description:  V5 project                                                */
/*                                                                            */
/*----------------------------------------------------------------------------*/

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name]               [Type]        [Port(s)]
// Mid_Intake           motor         7               
// Low_Intake_R         motor         4               
// Low_Intake_L         motor         5               
// High_Intake          motor         6               
// Elevator             motor         8               
// Controller1          controller                    
// Drivetrain           drivetrain    2, 1            
// ---- END VEXCODE CONFIGURED DEVICES ----

#include "vex.h"
#include "robot-config.h"


using namespace vex;
/*
int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();
  
}*/
// Include the V5 Library

  
// Allows for easier use of the VEX Library
using namespace vex;

float myVariable;

event message1 = event();
event why_am_i_here_______ = event();

//AUTONOMOUS CODE PATH
void autonomous(void){;
Low_Intake_L.rotateFor(vex::directionType::fwd, 2000 ,vex::rotationUnits::deg);


}


// "when started" hat block
int whenStarted1() {
  // Set all motors to max speed
  Mid_Intake.setVelocity(100.0, percent);
  Low_Intake_R.setVelocity(100.0, percent);
  Low_Intake_L.setVelocity(100.0, percent);
  High_Intake.setVelocity(100.0, percent);
  Elevator.setVelocity(100.0, percent);
  Drivetrain.setDriveVelocity(100.0, percent);
  Drivetrain.setTurnVelocity(100.0, percent);
  return 0;
}
// "when started" hat block
//Spin intakes and elevator when A or B are pressed
int whenStarted2() {
  while (true) {
    if (Controller1.ButtonA.pressing()) {
      Elevator.spin(forward);
      High_Intake.spin(forward);
      Mid_Intake.spin(forward);
    }
    else {
      if (Controller1.ButtonB.pressing()) {
        Elevator.spin(reverse);
        High_Intake.spin(reverse);
        Mid_Intake.spin(reverse);
      }
      else {
        Elevator.stop();
        High_Intake.stop();
        Mid_Intake.stop();
      }
    }
  wait(5, msec);
  }
  return 0;
}

// "when started" hat block
//Spin lower left and right intakes when r1 or r2 are pressed
int whenStarted3() {
  while (true) {
    if (Controller1.ButtonR1.pressing()) {
      Low_Intake_R.spin(forward);
      Low_Intake_L.spin(forward);
    }
    else {
      if (Controller1.ButtonR2.pressing()) {
        Low_Intake_R.spin(reverse);
        Low_Intake_L.spin(reverse);
      }
      else {
        Low_Intake_R.stop();
        Low_Intake_L.stop();
      }
    }
  wait(5, msec);
  }
  return 0;
}



using namespace vex;
using signature = vision::signature;
using code = vision::code;

// A global instance of brain used for printing to the V5 Brain screen
brain  Brain;

// VEXcode device constructors
motor Mid_Intake = motor(PORT7, ratio18_1, false);
motor Low_Intake_R = motor(PORT5, ratio18_1, false);
motor Low_Intake_L = motor(PORT4, ratio18_1, true);
motor High_Intake = motor(PORT6, ratio18_1, true);
motor Elevator = motor(PORT8, ratio18_1, false);
controller Controller1 = controller(primary);
motor LeftDriveSmart = motor(PORT2, ratio18_1, true);
motor RightDriveSmart = motor(PORT1, ratio18_1, false);
drivetrain Drivetrain = drivetrain(LeftDriveSmart, RightDriveSmart, 319.19, 295, 40, mm, 1);

// VEXcode generated functions
// define variable for remote controller enable/disable
bool RemoteControlCodeEnabled = true;
// define variables used for controlling motors based on controller inputs
bool Controller1RightShoulderControlMotorsStopped = true;
bool Controller1UpDownButtonsControlMotorsStopped = true;
bool Controller1XBButtonsControlMotorsStopped = true;

// define a task that will handle monitoring inputs from Controller1
int rc_auto_loop_function_Controller1() {
  // process the controller input every 20 milliseconds
  // update the motors based on the input values
  while(true) {
    if(RemoteControlCodeEnabled) {
      // check the ButtonR1/ButtonR2 status to control Elevator
      if (Controller1.ButtonR1.pressing()) {
        Elevator.spin(forward);
        Controller1RightShoulderControlMotorsStopped = false;
      } else if (Controller1.ButtonR2.pressing()) {
        Elevator.spin(reverse);
        Controller1RightShoulderControlMotorsStopped = false;
      } else if (!Controller1RightShoulderControlMotorsStopped) {
        Elevator.stop();
        // set the toggle so that we don't constantly tell the motor to stop when the buttons are released
        Controller1RightShoulderControlMotorsStopped = true;
      }
      // check the ButtonUp/ButtonDown status to control High_Intake
      if (Controller1.ButtonUp.pressing()) {
        High_Intake.spin(reverse);
        Controller1UpDownButtonsControlMotorsStopped = false;
      } else if (Controller1.ButtonDown.pressing()) {
        High_Intake.spin(forward);
        Controller1UpDownButtonsControlMotorsStopped = false;
      } else if (!Controller1UpDownButtonsControlMotorsStopped) {
        High_Intake.stop();
        // set the toggle so that we don't constantly tell the motor to stop when the buttons are released
        Controller1UpDownButtonsControlMotorsStopped = true;
      }
      // check the ButtonX/ButtonB status to control Mid_Intake
      if (Controller1.ButtonX.pressing()) {
        Mid_Intake.spin(reverse);
        Controller1XBButtonsControlMotorsStopped = false;
      } else if (Controller1.ButtonB.pressing()) {
        Mid_Intake.spin(forward);
        Controller1XBButtonsControlMotorsStopped = false;
      } else if (!Controller1XBButtonsControlMotorsStopped) {
        Mid_Intake.stop();
        // set the toggle so that we don't constantly tell the motor to stop when the buttons are released
        Controller1XBButtonsControlMotorsStopped = true;
      }
    }
    // wait before repeating the process
    wait(20, msec);
  }
  return 0;
}

/**
 * Used to initialize code/tasks/devices added using tools in VEXcode Pro.
 * 
 * This should be called at the start of your int main function.
 */
void vexcodeInit( void ) {
  task rc_auto_loop_task_Controller1(rc_auto_loop_function_Controller1);
}
int main() {
  task rc_auto_loop_task_Controller1(rc_auto_loop_function_Controller1);

  // post event registration

  // set default print color to black
  printf("\033[30m");

  // wait for rotation sensor to fully initialize
  wait(30, msec);

  vex::task ws1(whenStarted2);
  vex::task ws2(whenStarted3);
  whenStarted1();
}

Here is the Output when trying (and failing) to upload the code to the Brain:

[info]: Saving Project …

[info]: Project saved!

windows build for platform vexv5

“LINK build/52718B.elf”

build/src/robot-config.o:(.bss.Brain+0x0): multiple definition of `Brain’

build/src/main.o:(.bss.Brain+0x0): first defined here

build/src/robot-config.o:(.bss.Controller1+0x0): multiple definition of `Controller1’

build/src/main.o:(.bss.Controller1+0x0): first defined here

build/src/robot-config.o:(.data.Controller1RightShoulderControlMotorsStopped+0x0): multiple definition of `Controller1RightShoulderControlMotorsStopped’

build/src/main.o:(.data.Controller1RightShoulderControlMotorsStopped+0x0): first defined here

build/src/robot-config.o:(.data.Controller1UpDownButtonsControlMotorsStopped+0x0): multiple definition of `Controller1UpDownButtonsControlMotorsStopped’

build/src/main.o:(.data.Controller1UpDownButtonsControlMotorsStopped+0x0): first defined here

build/src/robot-config.o:(.data.Controller1XBButtonsControlMotorsStopped+0x0): multiple definition of `Controller1XBButtonsControlMotorsStopped’

build/src/main.o:(.data.Controller1XBButtonsControlMotorsStopped+0x0): first defined here

build/src/robot-config.o:(.bss.Drivetrain+0x0): multiple definition of `Drivetrain’

build/src/main.o:(.bss.Drivetrain+0x0): first defined here

build/src/robot-config.o:(.bss.Elevator+0x0): multiple definition of `Elevator’

build/src/main.o:(.bss.Elevator+0x0): first defined here

build/src/robot-config.o:(.bss.High_Intake+0x0): multiple definition of `High_Intake’

build/src/main.o:(.bss.High_Intake+0x0): first defined here

build/src/robot-config.o:(.bss.LeftDriveSmart+0x0): multiple definition of `LeftDriveSmart’

build/src/main.o:(.bss.LeftDriveSmart+0x0): first defined here

build/src/robot-config.o:(.bss.Low_Intake_L+0x0): multiple definition of `Low_Intake_L’

build/src/main.o:(.bss.Low_Intake_L+0x0): first defined here

build/src/robot-config.o:(.bss.Low_Intake_R+0x0): multiple definition of `Low_Intake_R’

build/src/main.o:(.bss.Low_Intake_R+0x0): first defined here

build/src/robot-config.o:(.bss.Mid_Intake+0x0): multiple definition of `Mid_Intake’

build/src/main.o:(.bss.Mid_Intake+0x0): first defined here

build/src/robot-config.o:(.data.RemoteControlCodeEnabled+0x0): multiple definition of `RemoteControlCodeEnabled’

build/src/main.o:(.data.RemoteControlCodeEnabled+0x0): first defined here

build/src/robot-config.o:(.bss.RightDriveSmart+0x0): multiple definition of `RightDriveSmart’

build/src/main.o:(.bss.RightDriveSmart+0x0): first defined here

build/src/robot-config.o: In function `vexcodeInit()’:

robot-config.cpp:(.text._Z11vexcodeInitv+0x0): multiple definition of `vexcodeInit()’

build/src/main.o:main.cpp:(.text._Z11vexcodeInitv+0x0): first defined here

build/src/robot-config.o: In function `rc_auto_loop_function_Controller1()’:

robot-config.cpp:(.text._Z33rc_auto_loop_function_Controller1v+0x0): multiple definition of `rc_auto_loop_function_Controller1()’

build/src/main.o:main.cpp:(.text._Z33rc_auto_loop_function_Controller1v+0x0): first defined here

make: *** [vex/mkrules.mk:18: build/52718B.elf] Error 1

[error]: make process closed with exit code : 2

Here’s the Terminal in case anyone’s interested. It doesn’t update when I try to download the code:
v5terminal V1.0

Device: COM10

v5terminal exit

v5terminal V1.0

Device: COM10

v5terminal exit

v5terminal V1.0

Device: COM10

COM10: No error

v5terminal V1.0

Device: COM10

v5terminal exit

v5terminal V1.0

Device: COM10

v5terminal exit

v5terminal V1.0

Device: COM10

v5terminal exit

v5terminal V1.0

Device: COM10

v5terminal exit

v5terminal V1.0

Device: COM10

/ *----------------------------------------------------------------------------* /
/* /
/ Module: main.cpp/
/Author: C:\Users\lrhoda0178 /
/Created: Sat Jan 23 2021/
/ Description: V5 project /
//
/ ----------------------------------------------------------------------------*/

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// Mid_Intake motor 7
// Low_Intake_R motor 4
// Low_Intake_L motor 5
// High_Intake motor 6
// Elevator motor 8
// Controller1 controller
// Drivetrain drivetrain 2, 1
// ---- END VEXCODE CONFIGURED DEVICES ----

#include “vex.h”
#include “robot-config.h”

using namespace vex;
/*
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();

}*/
// Include the V5 Library

// Allows for easier use of the VEX Library
using namespace vex;

float myVariable;

event message1 = event();
event why_am_i_here_______ = event();

//AUTONOMOUS CODE PATH
void autonomous(void){;
Low_Intake_L.rotateFor(vex::directionType::fwd, 2000 ,vex::rotationUnits::deg);

}

// “when started” hat block
int whenStarted1() {
// Set all motors to max speed
Mid_Intake.setVelocity(100.0, percent);
Low_Intake_R.setVelocity(100.0, percent);
Low_Intake_L.setVelocity(100.0, percent);
High_Intake.setVelocity(100.0, percent);
Elevator.setVelocity(100.0, percent);
Drivetrain.setDriveVelocity(100.0, percent);
Drivetrain.setTurnVelocity(100.0, percent);
return 0;
}
// “when started” hat block
//Spin intakes and elevator when A or B are pressed
int whenStarted2() {
while (true) {
if (Controller1.ButtonA.pressing()) {
Elevator.spin(forward);
High_Intake.spin(forward);
Mid_Intake.spin(forward);
}
else {
if (Controller1.ButtonB.pressing()) {
Elevator.spin(reverse);
High_Intake.spin(reverse);
Mid_Intake.spin(reverse);
}
else {
Elevator.stop();
High_Intake.stop();
Mid_Intake.stop();
}
}
wait(5, msec);
}
return 0;
}

// “when started” hat block
//Spin lower left and right intakes when r1 or r2 are pressed
int whenStarted3() {
while (true) {
if (Controller1.ButtonR1.pressing()) {
Low_Intake_R.spin(forward);
Low_Intake_L.spin(forward);
}
else {
if (Controller1.ButtonR2.pressing()) {
Low_Intake_R.spin(reverse);
Low_Intake_L.spin(reverse);
}
else {
Low_Intake_R.stop();
Low_Intake_L.stop();
}
}
wait(5, msec);
}
return 0;
}

using namespace vex;
using signature = vision::signature;
using code = vision::code;

// A global instance of brain used for printing to the V5 Brain screen
brain Brain;

// VEXcode device constructors
motor Mid_Intake = motor(PORT7, ratio18_1, false);
motor Low_Intake_R = motor(PORT5, ratio18_1, false);
motor Low_Intake_L = motor(PORT4, ratio18_1, true);
motor High_Intake = motor(PORT6, ratio18_1, true);
motor Elevator = motor(PORT8, ratio18_1, false);
controller Controller1 = controller(primary);
motor LeftDriveSmart = motor(PORT2, ratio18_1, true);
motor RightDriveSmart = motor(PORT1, ratio18_1, false);
drivetrain Drivetrain = drivetrain(LeftDriveSmart, RightDriveSmart, 319.19, 295, 40, mm, 1);

// VEXcode generated functions
// define variable for remote controller enable/disable
bool RemoteControlCodeEnabled = true;
// define variables used for controlling motors based on controller inputs
bool Controller1RightShoulderControlMotorsStopped = true;
bool Controller1UpDownButtonsControlMotorsStopped = true;
bool Controller1XBButtonsControlMotorsStopped = true;

// define a task that will handle monitoring inputs from Controller1
int rc_auto_loop_function_Controller1() {
// process the controller input every 20 milliseconds
// update the motors based on the input values
while(true) {
if(RemoteControlCodeEnabled) {
// check the ButtonR1/ButtonR2 status to control Elevator
if (Controller1.ButtonR1.pressing()) {
Elevator.spin(forward);
Controller1RightShoulderControlMotorsStopped = false;
} else if (Controller1.ButtonR2.pressing()) {
Elevator.spin(reverse);
Controller1RightShoulderControlMotorsStopped = false;
} else if (!Controller1RightShoulderControlMotorsStopped) {
Elevator.stop();
// set the toggle so that we don’t constantly tell the motor to stop when the buttons are released
Controller1RightShoulderControlMotorsStopped = true;
}
// check the ButtonUp/ButtonDown status to control High_Intake
if (Controller1.ButtonUp.pressing()) {
High_Intake.spin(reverse);
Controller1UpDownButtonsControlMotorsStopped = false;
} else if (Controller1.ButtonDown.pressing()) {
High_Intake.spin(forward);
Controller1UpDownButtonsControlMotorsStopped = false;
} else if (!Controller1UpDownButtonsControlMotorsStopped) {
High_Intake.stop();
// set the toggle so that we don’t constantly tell the motor to stop when the buttons are released
Controller1UpDownButtonsControlMotorsStopped = true;
}
// check the ButtonX/ButtonB status to control Mid_Intake
if (Controller1.ButtonX.pressing()) {
Mid_Intake.spin(reverse);
Controller1XBButtonsControlMotorsStopped = false;
} else if (Controller1.ButtonB.pressing()) {
Mid_Intake.spin(forward);
Controller1XBButtonsControlMotorsStopped = false;
} else if (!Controller1XBButtonsControlMotorsStopped) {
Mid_Intake.stop();
// set the toggle so that we don’t constantly tell the motor to stop when the buttons are released
Controller1XBButtonsControlMotorsStopped = true;
}
}
// wait before repeating the process
wait(20, msec);
}
return 0;
}

/**

* Used to initialize code/tasks/devices added using tools in VEXcode Pro.
* This should be called at the start of your int main function.
*/
void vexcodeInit( void ) {
task rc_auto_loop_task_Controller1(rc_auto_loop_function_Controller1);
}
int main() {
task rc_auto_loop_task_Controller1(rc_auto_loop_function_Controller1);

// post event registration

// set default print color to black
printf("\033[30m");

// wait for rotation sensor to fully initialize
wait(30, msec);

vex::task ws1(whenStarted2);
vex::task ws2(whenStarted3);
whenStarted1();
}

Formatted Code
As for why your program is not working, some of the stuff in your code is already in robot.config,cpp. Also, you don’t have a preatuon function or a driver control function. I would recommend just recreating the code in VEXcode V5 Pro rather than simply copying and pasting it into the file.

2 Likes

Thank you, I deleted the robot.config.cpp, and it works

Happy Cake Day! 20char

1 Like