[error]: make process closed with exit code : 2 VEXcode Pro V5 Text

Whenever I try to build this new code, I get this error: [error]: make process closed with exit code : 2. Can anyone tell me why? Here is the code:

#include "vex.h"

using namespace vex;

competition Competition;


void wait(float mSec){
vex::task::sleep(mSec);
}
//Drive A
int driveControlTask(){
while (Competition.isAutonomous()!=1){

LeftDrive.spin(vex::directionType::fwd, (Controller1.Axis4.value() * .5) + Controller1.Axis3.value() + 
Controller1.Axis1.value(),  vex::velocityUnits::pct);

RightDrive.spin(vex::directionType::fwd, (Controller1.Axis4.value() * -.5) + Controller1.Axis3.value() - 
Controller1.Axis1.value(), vex::velocityUnits::pct);

BackDrive.spin(vex::directionType::fwd, (Controller1.Axis4.value() * -1) + 
Controller1.Axis1.value(), vex::velocityUnits::pct);

wait(20, msec); 
} return(0);
}

//Pre-Autonomous
void pre_auton(void) {
vexcodeInit();

}
//Autonomous
void autonomous(void) {

}


//Drive B
void usercontrol(void) {
vex::task driveControl(driveControlTask);
Controller1.rumble(rumbleShort); 
int intakeSpeedpct = 100;
BottomSnail.setVelocity(100, percent);
TopSnail.setVelocity(100, percent);

while(1){
if(Controller1.ButtonL2.pressing()) {
TopSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct),
BottomSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct); 

}
else if(Controller1.ButtonL1.pressing()) {
BottomSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct); 
}
else if(Controller1.ButtonX.pressing()) {
TopSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct), 
BottomSnail.spin(vex::directionType::rev, intakeSpeedpct, vex::velocityUnits::pct);
}
else{
BottomSnail.stop(brake),
TopSnail.stop(brake);
}

if(Controller1.ButtonR2.pressing()) {
LeftIntake.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct), 
RightIntake.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct);
}
else if(Controller1.ButtonR1.pressing()) {
LeftIntake.spin(vex::directionType::rev, intakeSpeedpct, vex::velocityUnits::pct), 
RightIntake.spin(vex::directionType::rev, intakeSpeedpct, vex::velocityUnits::pct);
}
else{
LeftIntake.stop(brake),
RightIntake.stop(brake);
}

wait(20, msec); 
}
}

//Callbacks
int main() {
Competition.autonomous(autonomous);
Competition.drivercontrol(usercontrol);

pre_auton();

while (true) {
wait(100, msec);
}
}

[error]: make process closed with exit code : 2 is just a generic message that says “You have an error.” The actual error would be above that in the Output tab. Could you post the entire contents of the Output tab?

1 Like

This is what shows up:
[info]: Saving Project …
[info]: Project saved!
windows build for platform vexv5
“LINK build/KiwiPorgarm10621.elf”
build/src/main.o: In function main’:
main.cpp:(.text.main+0x30): undefined reference to `vexcodeInit()’
make: *** [vex/mkrules.mk:18: build/KiwiPorgarm10621.elf] Error 1
[error]: make process closed with exit code : 2

Aha! It says that vexcodeInit is undefined, so the name is probably wrong.

Try capitalizing vexcodeInit() to vexCodeInit()

1 Like

Thats interesting. I have it lowercase in my earlier program, and that works just fine. I will try it anyways.

Yes I changed it but it just made it into a real error, and told me to lowercase it.