I am also having this error please help me fix it I have tried fixing it myself and cannot figure it out.
Here is my code:
/*----------------------------------------------------------------------------*/
/* */
/* Module: main.cpp */
/* Author: C:\Users\Chad Montgomery */
/* Created: Tue Oct 06 2020 */
/* Description: V5 project */
/* */
/*----------------------------------------------------------------------------*/
// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// Controller1 controller
// Leftmotorback motor 5
// Rightmotorback motor 19
// Rightreelin motor 2
// Leftreelin motor 3
// Armmotor motor 6
// ---- END VEXCODE CONFIGURED DEVICES ----
#include "vex.h"
using namespace vex;
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
while(true) {
Brain.Screen.clearScreen(color::blue);
Brain.Screen.drawCircle(50,50,20,color::red);
if (Controller1.ButtonR2.pressing()) {
Forward();
}
while (Controller1.ButtonL2.pressing()) {
Backward();
}
//Torque
Rightmotorback.setMaxTorque(75, pct);
Leftmotorback.setMaxTorque(75, pct);
//Turning
Leftmotorback.spin(directionType::fwd, Controller1.Axis1.value(), pct);
Rightmotorback.spin(directionType::rev, Controller1.Axis1.value(), pct);
//Arm Motor
Armmotor.spin(directionType::fwd, Controller1.Axis3.value(), pct);
Armmotor.spin(directionType::rev, Controller1.Axis3.value(), pct);
if(Controller1.ButtonX.pressing()){
Rightreelin.spin(directionType::rev,100,velocityUnits::pct);
Leftreelin.spin(directionType::fwd,100,velocityUnits::pct);
}
else if(Controller1.ButtonB.pressing()){
Rightreelin.spin(directionType::fwd,100,velocityUnits::pct);
Leftreelin.spin(directionType::rev, 100, velocityUnits::pct);
}
//Driving brake type Hold
else if(Controller1.ButtonL1.pressing()) {
Leftmotorback.stop(brakeType::hold);
Rightmotorback.stop(brakeType::hold);
}
//Driving brake type coast
else if(Controller1.ButtonR1.pressing()) {
Leftmotorback.stop(brakeType::coast);
Rightmotorback.stop(brakeType::coast);
}
//Brake Types
else {
Rightreelin.stop(brakeType::hold);
Leftreelin.stop(brakeType::hold);
Armmotor.stop(brakeType::hold);
}
}
}
Here is my output and the error:
[info]: Saving Project …
[info]: Project saved!
windows build for platform vexv5
“CXX src/main.cpp”
“LINK build/TRexOfficialCode2vex.elf”
build/src/robot-config.o: In function `Forward()':
robot-config.cpp:(.text._Z7Forwardv+0x0): multiple definition of `Forward()’
build/src/main.o:main.cpp:(.text._Z7Forwardv+0x0): first defined here
build/src/robot-config.o: In function `Backward()':
robot-config.cpp:(.text._Z8Backwardv+0x0): multiple definition of `Backward()’
build/src/main.o:main.cpp:(.text._Z8Backwardv+0x0): first defined here
make: *** [vex/mkrules.mk:18: build/TRexOfficialCode2vex.elf] Error 1
[error]: make process closed with exit code : 2