Vexcode V5 help with make process closed with exit code : 2

Can I get help with my coding? Every time I go to build the cod I get the error message Make process closed with Exit code : 2

Hi @jakey12, welcome to the VEX Forum!

That error just means “your code didn’t compile”, there should be some additional lines earlier in the compiler output with more information.

To help you out, we’ll need to see the complete output of the “output” tab in vexcode, as well as your complete program. Please remember to include triple backtics (```) before and after both for formatting.

4 Likes

This is what it seas when I build the coad

windows build for platform vexv5

make: *** [vex/mkrules.mk:12: build/src/main.o] Error 1

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

this is my code

void usercontrol(void) {
  // User control code here, inside the loop
  while (1) {
    if(Controller1.Axis3.position(percent) != 0){
      LeftF.spin(forward, Controller1.Axis3.position(percent), pct) ;
      LeftB.spin(forward, Controller1.Axis3.position(percent), pct) ;
      RightF.spin(reverse, Controller1.Axis3.position(percent), pct) ;
      RightB.spin(reverse, Controller1.Axis3.position(percent), pct) ;
    }
    else if(Controller1.Axis2.position(percent) != 0){
      LeftF.spin(forward, Controller1.Axis2.position(percent), pct) ;
      LeftB.spin(forward, Controller1.Axis2.position(percent), pct) ;
      RightF.spin(reverse, Controller1.Axis2.position(percent), pct) ;
      RightB.spin(reverse, Controller1.Axis2.position(percent), pct) ;
    }
    else{
      LeftF.stop(coast);
      LeftB.stop(coast);
      RightF.stop(coast);
      RightB.stop(coast);

    }
 
   
    wait(20, msec);
  }
}

Is this the entire code? Looks like you are using the competition template, and just looking at the usercontrol function, this looks fine (it will compile). Can the issue be somewhere else?

1 Like

That is all I coded. Everything else is left the same. I haven’t even touched the rest of the competition template. It isn’t telling me anything is wrong when I look at the problems tab.

Just in case something else is wrong here is the whole code and problem message.

/*----------------------------------------------------------------------------*/
/*                                                                            */
/*    Module:       main.cpp                                                  */
/*    Author:       VEX                                                       */
/*    Created:      Thu Sep 26 2019                                           */
/*    Description:  Competition Template                                      */
/*                                                                            */
/*----------------------------------------------------------------------------*/

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name]               [Type]        [Port(s)]
// Controller1          controller                    
// LeftF                motor         2               
// LeftB                motor         3               
// RightF               motor         9               
// RightB               motor         10              
// ---- END VEXCODE CONFIGURED DEVICES ----

#include "vex.h"

using namespace vex;

// A global instance of competition
competition Competition;

// define your global instances of motors and other devices here

/*---------------------------------------------------------------------------*/
/*                          Pre-Autonomous Functions                         */
/*                                                                           */
/*  You may want to perform some actions before the competition starts.      */
/*  Do them in the following function.  You must return from this function   */
/*  or the autonomous and usercontrol tasks will not be started.  This       */
/*  function is only called once after the V5 has been powered on and        */
/*  not every time that the robot is disabled.                               */
/*---------------------------------------------------------------------------*/

void pre_auton(void) {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // All activities that occur before the competition starts
  // Example: clearing encoders, setting servo positions, ...
}

/*---------------------------------------------------------------------------*/
/*                                                                           */
/*                              Autonomous Task                              */
/*                                                                           */
/*  This task is used to control your robot during the autonomous phase of   */
/*  a VEX Competition.                                                       */
/*                                                                           */
/*  You must modify the code to add your own robot specific commands here.   */
/*---------------------------------------------------------------------------*/

void autonomous(void) {
  // ..........................................................................
  // Insert autonomous user code here.
  // ..........................................................................
}

/*---------------------------------------------------------------------------*/
/*                                                                           */
/*                              User Control Task                            */
/*                                                                           */
/*  This task is used to control your robot during the user control phase of */
/*  a VEX Competition.                                                       */
/*                                                                           */
/*  You must modify the code to add your own robot specific commands here.   */
/*---------------------------------------------------------------------------*/

void usercontrol(void) {
  // User control code here, inside the loop
  while (1) {
    if(Controller1.Axis3.position(percent) != 0){
      LeftF.spin(forward, Controller1.Axis3.position(percent), pct) ;
      LeftB.spin(forward, Controller1.Axis3.position(percent), pct) ;
      RightF.spin(reverse, Controller1.Axis3.position(percent), pct) ;
      RightB.spin(reverse, Controller1.Axis3.position(percent), pct) ;
    }
    else if(Controller1.Axis2.position(percent) != 0){
      LeftF.spin(forward, Controller1.Axis2.position(percent), pct) ;
      LeftB.spin(forward, Controller1.Axis2.position(percent), pct) ;
      RightF.spin(reverse, Controller1.Axis2.position(percent), pct) ;
      RightB.spin(reverse, Controller1.Axis2.position(percent), pct) ;
    }
    else{
      LeftF.stop(coast);
      LeftB.stop(coast);
      RightF.stop(coast);
      RightB.stop(coast);

    }
 
   
    wait(20, msec);
  }
}

//
// Main will set up the competition functions and callbacks.
//
int main() {
  // Set up callbacks for autonomous and driver control periods.
  Competition.autonomous(autonomous);
  Competition.drivercontrol(usercontrol);

  // Run the pre-autonomous function.
  pre_auton();

  // Prevent main from exiting with an infinite loop.
  while (true) {
    wait(100, msec);
  }
}

(edit: mods added code tags…)

This is the problem message

[info]: Saving Project …

[info]: Project saved!

windows build for platform vexv5

make: *** [vex/mkrules.mk:12: build/src/main.o] Error 1

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

Are these lines part of your code, or are they something that got translated as part of the formatting when pasting your code here? I assume they are part of your code since I see a bunch of them.

This could be your issue. These are supposed to be comments, but you’ll need a double slash (//) and not just one slash (/). Change them to double slash in the beginning of each comment to fix this.

You can also use the /* */ to make all text inside that block as a comment. That way you don’t need to do the // at beginning of each line of comments.

3 Likes

All of those are green. They were part of the compaction template

Will a new project build ?

This looks more like you changed something in the build files or your PC is not able to execute the compiler or something along those lines. Did you rename the project ? Does the project have any special characters in the name ? (things like *&^ etc.)

1 Like

No the name is the same as the save file and I haven’t touched that since saving it when I first created the new code file

I only have dashes in the name

Try changing this line in the makefile. (you may need to enable display of build files in the preference dialog)

# show compiler output
VERBOSE = 0

to this

# show compiler output
VERBOSE = 1

Then build again, paste the contents of the output tab in this topic, that may give more clues as to what is wrong.

2 Likes

I tryd that and it does not solve the problem

sure, it will not solve the problem, I asked you to show the build output, there should be more useful information.

1 Like

How would I edit the makefile? What would I do after editing it from 0 to 1?

Hm, ok, so I made the assumption that you were using VEXcode V5 Pro.
If that’s the case, then show the build files (enable in the pref dialog box) and you will see the makefile in the project pane.
after editing, build the project again.
image

But maybe that was a bad assumption, I don’t know. but you did say you tried it…

If you are using VEXcode (with blocks etc.) then there is no way to access the build files.

if VERBOSE is 0, then output is simplified.

unix build for platform vexv5
CXX src/main.cpp
LINK build/testproj.elf
   text	   data	    bss	    dec	    hex	filename
   6004	   1092	1063792	1070888	 105728	build/testproj.elf
[info]: build completed!

if VERBOSE is 1, then there will be more complex output.

unix build for platform vexv5
mkdir -p "build/src" 2> /dev/null || :
CXX src/main.cpp
clang -target thumbv7-none-eabi -fshort-enums -Wno-unknown-attributes -U__INT32_TYPE__ -U__UINT32_TYPE__ -D__INT32_TYPE__=long -D__UINT32_TYPE__='unsigned long'  -march=armv7-a -mfpu=neon -mfloat-abi=softfp -Os -Wall -Werror=return-type -fno-rtti -fno-threadsafe-statics -fno-exceptions  -std=gnu++11 -ffunction-sections -fdata-sections -DVexV5 -Iinclude -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/include" -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/clang/8.0.0/include" -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/gcc/include"  -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/gcc/include/c++/4.9.3"  -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/gcc/include/c++/4.9.3/arm-none-eabi/armv7-ar/thumb" -c -o build/src/main.o src/main.cpp
mkdir -p "build/src" 2> /dev/null || :
CXX src/robot-config.cpp
clang -target thumbv7-none-eabi -fshort-enums -Wno-unknown-attributes -U__INT32_TYPE__ -U__UINT32_TYPE__ -D__INT32_TYPE__=long -D__UINT32_TYPE__='unsigned long'  -march=armv7-a -mfpu=neon -mfloat-abi=softfp -Os -Wall -Werror=return-type -fno-rtti -fno-threadsafe-statics -fno-exceptions  -std=gnu++11 -ffunction-sections -fdata-sections -DVexV5 -Iinclude -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/include" -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/clang/8.0.0/include" -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/gcc/include"  -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/gcc/include/c++/4.9.3"  -I"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/gcc/include/c++/4.9.3/arm-none-eabi/armv7-ar/thumb" -c -o build/src/robot-config.o src/robot-config.cpp
LINK build/testproj.elf
arm-none-eabi-ld -nostdlib -T "/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/lscript.ld" -R "/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/stdlib_0.lib" -Map="build/testproj.map" --gc-section -L"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5" -L"/Users/james/Library/Application Support/VEXcode Pro V5/Default/sdk/20211014_16_00_00/vexv5/gcc/libs" -o build/testproj.elf build/src/main.o build/src/robot-config.o --start-group -lv5rt -lstdc++ -lc -lm -lgcc --end-group
arm-none-eabi-size build/testproj.elf
   text	   data	    bss	    dec	    hex	filename
   6004	   1092	1063792	1070888	 105728	build/testproj.elf
arm-none-eabi-objcopy -O binary build/testproj.elf build/testproj.bin
[info]: build completed!
2 Likes

I’m using Vexcoad V5 pro. I edited the VERBOSE from 0 to 1 and built it. This is the message.

[info]: Saving Project …

[info]: Project saved!

windows build for platform vexv5

md “build/src” 2> nul || :

make: *** [vex/mkrules.mk:12: build/src/main.o] Error 1

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

i have had this happen before, and i just copy and pasted each part of the code (preauton, auton, and drivercontrol) into a new competition template and it worked.