I have been trying to compile my code, and it results in this output:
Creating cold package with libc,libm,libpros,okapilib [OK]
Stripping cold package [DONE]
Section sizes:
text data bss total hex filename
1.32MB 4.36KB 47.66MB 48.97MB 30f83bc bin/cold.package.elf
Compiled src/auton.cpp [OK]
Compiled src/autonmethods.cpp [OK]
Compiled src/globals.cpp [OK]
Compiled src/main.cpp [OK]
Adding timestamp [OK]
Linking hot project with ./bin/cold.package.elf and libc,libm,libpros,okapilib [ERRORS]
c:/program files/pros/toolchain/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: bin/main.cpp.o: in function `opcontrol':
C:\Users\mcurn\OneDrive\Documents\GitHub\6210M-Over-Under/src/main.cpp:70: undefined reference to `mIntake'
collect2.exe: error: ld returned 1 exit status
make: *** [common.mk:239: bin/hot.package.elf] Error 1
ERROR - pros.cli.build:make - Failed to make project: Exit Code 2
Error: Failed to build```
Here is line 70:
if(selectionIndex > 1) selectionIndex = 0;
If that line is commented out, a similar error is thrown complaining about line 93, which has a similar command to line 70 on it. If this is commented out as well, it claims there is an undefined reference to mIntake on line 203, a line that only holds a single curly bracket }.
The only lines in main.cpp that reference mIntake are lines 161-167:
if(master.get_digital(DIGITAL_R1)){
mIntake = 127;
} else if(master.get_digital(DIGITAL_R2)){
mIntake = -127;
} else{
mIntake = 0;
}
If these lines are commented out, the program builds just fine. Any ideas on how to fix this?